home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / PAMAKE18.ZIP / MAKEFILE < prev    next >
Text File  |  1989-09-30  |  6KB  |  169 lines

  1. #   PAMAKE makefile by Roundhill Computer Systems Limited   September 1989
  2. #
  3. #   This PAMAKE makefile builds the PAMAKE programs for DOS and OS/2,
  4. #   which are named PAMAKER and PAMAKEP respectively, using Microsoft
  5. #   C version 5.1.  We recommend that you rename these to PAMAKE and 
  6. #   place them in your BIN directories for DOS and OS/2 executables.  
  7. #   You can make a bound version if you wish, but the Microsoft version
  8. #   is quite a bit larger than either of the other versions.  If you 
  9. #   need a bound version which runs under OS/2 and DOS, you will find
  10. #   that Lattice C is *much* better than Microsoft for this.  There's
  11. #   a makefile called MAKEFILE.LC which builds a family mode program.
  12. #   If you only have the Microsoft compiler, you will probably find it
  13. #   preferable, as we did, to build a dual-mode version PAMAKE.EXE by 
  14. #   defining the DOS version as the stub for the OS/2 version.  The EXE
  15. #   file is bigger, but you do not have the Microsoft family-mode 
  16. #   run-time overhead.  This file contains command to build such a 
  17. #   dual-mode version.
  18. #
  19. #   Of course, you will need one of these programs to run this makefile
  20. #   to build them.  This phenomenon is known as `self-reference'.
  21. #
  22. #   For information on the PAMAKE make utility, see PAMAKE.DOC
  23. #
  24. #   The directory structure for which this makefile was constructed is
  25. #   as follows:
  26. #
  27. #   \msc51\bin      :  DOS C compiler executables
  28. #   \msc51\binp     :  OS/2 C compiler executables
  29. #   \msc51\binb     :  miscellaneous bound executables
  30. #   \msc51\include  :  .H files
  31. #   \msc51\lib      :  compiler library files
  32. #
  33. #   This makefile is invoked from the \msc51\pamake directory which
  34. #   contains the C and H files for PAMAKE.
  35. #
  36. #   Note: use a renamed version of one of the targets of this make
  37. #         in order to rebuild it under OS/2.  OS/2 will not allow
  38. #         writing to the EXE file while it is actually running, and
  39. #         you will get an error when LINK writes to it or BIND tries
  40. #         to delete it.
  41. #
  42. #   --------------------------------------------------------------------
  43.  
  44. target: pamakep.exe pamaker.exe pamake.exe
  45.     +@echo make complete:  target is up-to-date
  46.  
  47. #   --------------------------------------------------------------------
  48. #
  49. #   The following macro definitions are placed in the DOS environment
  50. #   during execution of PAMAKE.  Modify them to specify the pathnames
  51. #   which apply in your system.  Note that the PATH must include all
  52. #   directories which contain commands to be executed by PAMAKE, since
  53. #   it overrides your previous path during the execution of the make.
  54. #
  55. #   --------------------------------------------------------------------
  56.  
  57. RAM=h:\             # ram drive: change this line if yours is different
  58. #TMP=$(RAM)         # set TMP environment variable for MSC: delete if none
  59.  
  60. #if PAMAKE_OS=OS2
  61. +PATH=\msc51\binb;\msc51\binp
  62. #else
  63. +PATH=\msc51\binb;\msc51\bin;e:\bin
  64. #endif
  65.  
  66. +INCLUDE=\msc51\include
  67. +LIB=\msc51\lib
  68.  
  69. #if TEST=1
  70. O=/Od          # disable optimisation
  71. Z=/Zi          # generate CV records in OBJ
  72. C=/CO          # generate CV records in EXE
  73. #else
  74. O=/Olt         # maximum optimisation, without intrinsics
  75. #endif
  76.  
  77. #   --------------------------------------------------------------------
  78. #
  79. #   The following macro definitions are used to specify to PAMAKE the 
  80. #   overrides required in Microsoft C v5.1 if both real and protected
  81. #   mode libraries are in use with different names.  
  82. #
  83. #   --------------------------------------------------------------------
  84.  
  85. REALLIB=/nod:$Mlibce $Mlibcer           # real-mode libary override
  86. PROTLIB=/nod:$Mlibce $Mlibcep           # protect-mode library override
  87.  
  88. #   --------------------------------------------------------------------
  89. #
  90. #   PAMAKE has a built-in command of $(CC) $(CFLAGS) $(CFILES) for C 
  91. #   compilations.  Here we set these macros for the Microsoft compiler.
  92. #
  93. #   --------------------------------------------------------------------
  94.  
  95. M=S                                     # small model
  96. CC=cl                                   # Microsoft C compilation
  97. CFLAGS=/c $O /A$M /W3 $Z /DMSC
  98. CFILES=$<
  99.  
  100. .SUFFIXES:                              # clear suffixes list
  101. .SUFFIXES: .c                           # not .asm and .pnl as built-in
  102.  
  103. #   --------------------------------------------------------------------
  104. #
  105. #   Here are the programs to build
  106. #
  107. #   --------------------------------------------------------------------
  108.  
  109. OBJS= check.obj input.obj macro.obj reader.obj rules.obj ifproc.obj mtime.obj
  110.  
  111. #   Protected Mode Version
  112.  
  113. pamakep.exe: mainp.obj makep.obj $(OBJS)
  114.     link @$-
  115. mainp+check+input+macro+makep+reader+rules+ifproc+mtime+$(LIB)\apilmr
  116. pamakep
  117. pamakep $C
  118. $(PROTLIB) doscalls
  119. ;
  120. <
  121.  
  122. #   Real Mode Version
  123.  
  124. pamaker.exe: mainr.obj maker.obj $(OBJS)
  125.     link @$-
  126. mainr+check+input+macro+maker+reader+rules+ifproc+mtime/cp:1/st:4096
  127. pamaker
  128. pamaker $C
  129. $(REALLIB)
  130. ;
  131. <
  132.  
  133. #   Dual-mode Version
  134.  
  135. pamake.exe: mainp.obj makep.obj $(OBJS) pamaker.exe
  136.     copy $- pamake.def
  137. NAME PAMAKE
  138. STUB 'PAMAKER.EXE'
  139. <
  140.     link @$-
  141. mainp+check+input+macro+makep+reader+rules+ifproc+mtime+$(LIB)\apilmr
  142. pamake
  143. pamake $C
  144. $(PROTLIB) doscalls
  145. pamake.def;
  146. <
  147.  
  148. #   --------------------------------------------------------------------
  149. #
  150. #   Commands to build objects.
  151. #
  152. #   --------------------------------------------------------------------
  153.  
  154. mainr.obj: main.c h.h 
  155.     $(CC) $(CFLAGS) /DPAMDOS /Fomainr.obj main.c
  156. mainp.obj: main.c h.h
  157.     $(CC) $(CFLAGS) /DPAMOS2 /Fomainp.obj main.c
  158. maker.obj: make.c h.h 
  159.     $(CC) $(CFLAGS) /DPAMDOS /Fomaker.obj make.c 
  160. makep.obj: make.c h.h
  161.     $(CC) $(CFLAGS) /DPAMOS2 /Fomakep.obj make.c
  162. $(OBJS): h.h
  163.  
  164. #   --------------------------------------------------------------------
  165. #
  166. #   end of makefile
  167. #
  168. #   --------------------------------------------------------------------
  169.