home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / rng-810.zip / makefile < prev    next >
Makefile  |  1994-02-01  |  5KB  |  205 lines

  1. #
  2. # Copyright (c) Sirius Software 1992.
  3. # All rights reserved.
  4. # But the README.DOC from Sirius Software file says:
  5. # This software is hereby placed in the public domain.
  6.  
  7. # RANDDRV.SYS random number driver for RNG-810 random # or similar.
  8. # Copyright (C) 1994 Paul Elliot
  9. #
  10. # This program is free software; you can redistribute it and/or
  11. # modify it under the terms of the GNU General Public License
  12. # as published by the Free Software Foundation; either version 2
  13. # of the License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. #
  24. #Paul.Elliott@Hrnowl.LoneStar.Org
  25. #
  26. #Paul Elliott
  27. #
  28. #3986 South Gessner #224 Houston TX 77063
  29. #
  30. #
  31. # file_name = c0.asm
  32. #
  33. # Notes:
  34. #    - created June 28, 1992 GWS
  35. #    - modified for BC++ 3.0 for DOS May 2, 1993 GWS
  36. #
  37.  
  38. #    - modified paul elliottjan 24-94
  39. #    - requires access to runtime source
  40. #    - and the gnu sed program for ms-dos.
  41.  
  42. # To use you must have borland's runtime source, available from
  43. # borland, and a copy of sed, a publicly available batch editor.
  44.  
  45.  
  46. .AUTODEPEND
  47.  
  48. BASENAME = randdrv
  49.  
  50. CMODEL=c
  51. ASMMODEL=COMPACT
  52.  
  53. # path to the compiler
  54. COMPILER_PATH = F:\msdos\borlandc
  55.  
  56. COMPILER_FLAGS = -c -m$(CMODEL) -2 -I$(COMPILER_PATH)\include -H=$(BASENAME).sym -w-rvl
  57.  
  58. ASSEMBLER_FLAGS = -ml -s
  59.  
  60. # compile with BSS segment redirected to RBSS, DATA redirected to RDATA.
  61. # used to compile c++ code that must remain resident after INIT.
  62. RESIDENT= -zD_RBSS -zR_RDATA -zBDATA
  63.  
  64. #
  65. # if you have access to the 16 bit OS2.LIB add it to the following macro
  66. # and get rid of the import section in the .DEF linker file
  67. #
  68.  
  69. OS2_LIB = c:\os2\doscalls.lib
  70.  
  71. .asm.obj :
  72.     tasm $(ASSEMBLER_FLAGS)   $*,$*,$*,$*;
  73.  
  74. .c.obj :    
  75.     bcc -S $*.c
  76.     -del $*.ast
  77.     ren $*.asm $*.ast
  78.     bcc $*.c
  79.  
  80. .cpp.obj :
  81.     bcc -S $*.cpp
  82.     -del $*.ast
  83.     ren $*.asm $*.ast
  84.     bcc $*.cpp
  85.  
  86. target : turboc.cfg $(BASENAME).sys
  87.  
  88. # delete anything owned by borland, so remainder
  89. # can be released.
  90. propriety:
  91.     -del rinc\rules.asi
  92.     -rmdir rinc
  93.     -del movmem.obj
  94.     -del N_PCMP.OBJ
  95.  
  96. clean    :
  97.     -del *.xrf
  98.     -del *.sym
  99.     -del *.sed
  100.     -del *.lst
  101.     -del *.ast
  102.     -del *.obj
  103.     -del *.bak
  104.     -del *.dll
  105.     -del *.map
  106.     -del *.err
  107.     -del *.def
  108.     -del rinc\rules.asi
  109.     -rmdir rinc
  110.     -del chksum.dat chksum.pgp randdrv.chk
  111.  
  112. #clean all but the driver itself!
  113. sclean    :
  114.     -del *.xrf
  115.     -del *.sym
  116.     -del *.sed
  117.     -del *.lst
  118.     -del *.ast
  119.     -del *.obj
  120.     -del *.bak
  121.     -del *.dll
  122.     -del *.map
  123.     -del *.err
  124.     -del *.def
  125.     -del rinc\rules.asi
  126.     -rmdir rinc
  127.     -del chksum.dat chksum.pgp randdrv.chk
  128.  
  129.  
  130. $(BASENAME).def : makefile
  131.     echo LIBRARY $(BASENAME) >$*.def
  132.     echo PROTMODE>>$*.def
  133.  
  134. $(BASENAME).obj :    $(BASENAME).cpp $(BASENAME).H turboc.cfg rand.h
  135.     bcc $(RESIDENT) -S $*.cpp
  136.     -del $*.ast
  137.     ren $*.asm $*.ast
  138.     bcc $(RESIDENT) $*.cpp
  139.  
  140.  
  141.  
  142. turboc.cfg : makefile
  143.     copy &&|
  144. $(COMPILER_FLAGS)
  145. | $<
  146.  
  147. # The device driver structure requires a header in the data segment.
  148. # To make sure this comes first place the header structure in the
  149. # module immediately after the c0.obj file in the linker line
  150. #
  151. $(BASENAME).sys : c0.obj $(BASENAME).obj rand.obj $(BASENAME).def rand.obj codend.obj startup.obj start.obj movmem.obj N_PCMP.OBJ
  152. # modules before codend are resident.
  153. # modules after codend exist ONLY till INIT completes.
  154. # movmem  is used by code that exists after INIT so must be specially compiled.
  155.     tlink /m/s c0+$(BASENAME)+rand+movmem+N_pcmp+codend+startup+start,$(BASENAME),,$(COMPILER_PATH)\lib\cc.lib $(OS2_LIB),$(BASENAME)/m;
  156.     -del $(BASENAME).sys
  157.     ren $(BASENAME).dll $(BASENAME).sys
  158.  
  159. # movmem from the RTL must be compiled so that it's segments
  160. # can be placed to remain resident.
  161. movmem.obj :
  162.     bcc -S $(RESIDENT) -I$(COMPILER_PATH)\crtl\rtlinc $(COMPILER_PATH)\crtl\clib\movmem.cas 
  163.     -del $*.ast
  164.     ren $*.asm $*.ast
  165.     bcc $(RESIDENT) -I$(COMPILER_PATH)\crtl\rtlinc $(COMPILER_PATH)\crtl\clib\movmem.cas 
  166.  
  167. # create a SED control file which changes 'BSS' to 'DATA'
  168. # and _DATA to _RDATA and _BSS to _RBSS
  169. mod.sed:    makefile
  170.     copy &&%
  171. /\([     ]\)\(segment\|SEGMENT\)\([     ]\)/s/'BSS'/'DATA'/g
  172. s/\(^\|[     ,:]\)_BSS/\1_RBSS/g
  173. s/\(^\|[     ,:]\)_DATA/\1_RDATA/g
  174. % $<
  175. # change 'BSS' to 'DATA'
  176. # change _BSS to _RBSS
  177. # change _DATA to _RDATA
  178.  
  179.  
  180. # create a copy of BORLAND'S RULES.ASI with the above changes.
  181. RINC\RULES.ASI:    mod.sed
  182.     -MKDIR    RINC
  183.     sed -fmod.sed $(COMPILER_PATH)\Crtl\rtlinc\rules.asi > $<
  184.  
  185.  
  186. # compile N_PCMP.ASM useing modified rules.asi.
  187. # NPCMP.OBJ is used by movmem at runtime!
  188. N_PCMP.OBJ:    rinc\RULES.ASI
  189.     tasm -D__COMPACT__ /mx /s /iRINC $(COMPILER_PATH)\crtl\clib\N_PCMP.ASM,N_PCMP,N_PCMP,N_PCMP;
  190.  
  191.  
  192. randdrv.chk:    makefile 
  193.     -mkdir sum
  194.     -del chksum.dat
  195.     for %%x in (*.* test\*.*) do echo %%x >>sum\list.dat
  196.     -echo "unix chksums for each file" >chksum.dat
  197.     chksum -v -- <sum\list.dat >>chksum.dat
  198.     -del sum\list.dat
  199.     -rmdir sum
  200.     pgp -sat +clearsig=on chksum.dat -u "Paul Elliott"
  201.     -del randdrv.chk
  202.     ren chksum.asc randdrv.chk
  203.  
  204.