Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

300 lines
8.2 KiB

  1. # dos makefile for masm.exe
  2. # The environment variable MASMOS (MASM Operating System) is used
  3. # to determin whether to build OS2 2.0/32 bit version or a normal
  4. # OS2 1.2 version.
  5. #
  6. !IF "$(MASMOS)"!="OS2_2"
  7. # Setup to build NON OS2 2.0 version of MASM
  8. BUILDTYPE = MSDOS
  9. #Default version to build
  10. OD=OBJ\OS2.12
  11. MVERSION = $(OD)\masm5pi
  12. CC = cl
  13. # memory model for .c sources
  14. CMODEL = -AM
  15. SPCLMODEL = -Alnu
  16. ATEXT = -NT A_TEXT
  17. MKMSGFLG =
  18. OPT = -Owtr
  19. OLOOP = -Ol
  20. OMAX = -Ol
  21. # memory model for .asm sources
  22. AMODEL = -DMEDIUM
  23. !ELSE
  24. # Setup to build OS2 2.0 version of MASM
  25. BUILDTYPE = OS2_2
  26. #Default version to build
  27. OD=OBJ\OS2.20
  28. MVERSION = $(OD)\masm386i
  29. CC = cl386
  30. # memory model for .c sources
  31. CMODEL = -AS
  32. SPCLMODEL = -AS
  33. ATEXT =
  34. MKMSGFLG = -32
  35. OPT = -Od
  36. OLOOP = -Od
  37. OMAX = -Od
  38. # memory model for .asm sources
  39. AMODEL = -DSMALL
  40. # Include directory for 386 floating point code
  41. ID386 = INC386
  42. !ENDIF
  43. A = masm
  44. L = link
  45. L5 = link
  46. L32 = link386
  47. MODE = -Lp
  48. MAKEV = makev.exe
  49. # Release number, comment next two lines out for release version
  50. REL=.01
  51. RELEASE=-DRELEASE=$(REL)
  52. # symbolic debugging support
  53. #DEBUG =
  54. DEBUG = -Zi
  55. #DEBUGLINE = -Zd
  56. DEBUGLINE = -Zi
  57. # 386 support option
  58. V386 =
  59. #V386 = -DNOV386
  60. # kind of optimization; time, size, or none
  61. # C 5.1, OPT = -Oatr
  62. OPT = -Owtr
  63. OLOOP = -Ol
  64. OMAX = -Ol
  65. # Warning level to use
  66. WARN = -W2
  67. # standard cc invocation lines
  68. D = -D$(BUILDTYPE) $(V386) $(O1)
  69. CDEFS = -u $(D) $(CMODEL) $(OPT) -c -nologo $(WARN)
  70. COMPILE = $(CC) $(CDEFS) -Gs -Fo$@
  71. I = asm86.h asmfcn.h asmdebug.h asmconf.h
  72. O = $(OD)\asmalloc.obj $(OD)\asmchksp.obj $(OD)\asmcond.obj\
  73. $(OD)\asmcref.obj $(OD)\asmdata.obj $(OD)\asmdir.obj \
  74. $(OD)\asmemit.obj $(OD)\asmequ.obj $(OD)\asmerr.obj \
  75. $(OD)\asmerrtb.obj $(OD)\asmeval.obj $(OD)\asmexpr.obj \
  76. $(OD)\asmflt.obj $(OD)\asminptb.obj $(OD)\asmirp.obj \
  77. $(OD)\asmlst.obj $(OD)\asmmac.obj $(OD)\asmopc.obj \
  78. $(OD)\asmopcod.obj $(OD)\asmpars.obj $(OD)\asmrec.obj \
  79. $(OD)\asmsym.obj $(OD)\asmtab.obj $(OD)\asmtabt2.obj \
  80. $(OD)\asmtabtb.obj $(OD)\asmutl.obj $(OD)\version.obj \
  81. $(OD)\cmasm.obj $(OD)\cui.obj $(OD)\casminp.obj
  82. OPROT = $(OD)\casmhelp.obj $(OD)\asmmsg.obj
  83. O386 = $(OD)\msghdr.obj
  84. default: $(MVERSION).exe
  85. all: masm5.exe masm5b.exe cref.exe crefb.exe
  86. # When OS2_2 is set a dos version of the assembler can't be built
  87. !IF "$(MASMOS)"!="OS2_2"
  88. $(OD)\masm5p.exe: $(O) $(OPROT)
  89. $(L5) /batch @masm5p.lnk,$(OD)\$(@B).exe,nul,mlibcep doscalls,masm.def;
  90. $(OD)\masm5pi.exe: $(O) $(OPROT)
  91. $(L5) /map /batch /co @masm5p.lnk,$(OD)\$(@B).exe,$(OD)\$(@B).map,mlibcep doscalls,masm.def;
  92. mapsym $(OD)\$(@B).map
  93. copy $(@B).sym $(OD)\$(@B).sym
  94. -del $(@B).sym
  95. $(OD)\masm5b.exe: masm5p.exe
  96. bind $(OD)\masm5p.exe $(LIB)\doscalls.lib $(LIB)\apilmr.obj -o $(OD)\masm.exe
  97. -del $(OD)\masm5b.exe
  98. ren $(OD)\masm.exe $(OD)\masm5b.exe
  99. !ELSE
  100. $(OD)\masm386.exe: $(O) $(OD)\version.obj $(O386)
  101. $(L32) /batch @masm386.lnk,$(OD)\$(@B).exe,nul,libc os2386,masm.def;
  102. $(OD)\masm386i.exe: $(O) $(OD)\version.obj $(O386)
  103. $(L32) /map /batch /co @masm386.lnk,$(OD)\$(@B).exe,$(OD)\$(@B).map,libc os2386,masm.def;
  104. mapsym $(OD)\$(@B).map
  105. copy $(@B).sym $(OD)\$(@B).sym
  106. -del $(@B).sym
  107. !ENDIF
  108. # This is how asmmsg.h was created prior to NT not having mkmsg available
  109. # asmmsg.h: asmmsg.txt
  110. # mkmsg -h $@ asmmsg.txt
  111. $(OD)\asmalloc.obj: asmalloc.c asm86.h
  112. $(COMPILE) $(ATEXT) $(DEBUGLINE) asmalloc.c
  113. $(OD)\asmchksp.obj: asmchksp.c $(I) asmctype.h asmopcod.h asmexpr.h
  114. $(CC) $(CDEFS) $(OLOOP) $(ATEXT) $(DEBUG) -Fo$@ asmchksp.c
  115. $(OD)\asmcond.obj: asmcond.c $(I) asmctype.h
  116. $(COMPILE) $(ATEXT) $(DEBUGLINE) asmcond.c
  117. $(OD)\asmcref.obj: asmcref.c $(I)
  118. $(COMPILE) $(DEBUGLINE) asmcref.c
  119. $(OD)\asmdata.obj: asmdata.c $(I) asmctype.h asmmsg.h
  120. $(COMPILE) $(ATEXT) $(DEBUG) asmdata.c
  121. $(OD)\asmdir.obj: asmdir.c $(I) asmctype.h asmmsg.h
  122. $(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmdir.c
  123. $(OD)\asmemit.obj: asmemit.c $(I)
  124. $(COMPILE) $(ATEXT) $(DEBUG) asmemit.c
  125. $(OD)\asmequ.obj: asmequ.c $(I) asmctype.h asmmsg.h
  126. $(COMPILE) $(ATEXT) $(DEBUG) asmequ.c
  127. $(OD)\asmerr.obj: asmerr.c $(I) asmmsg.h
  128. $(COMPILE) $(ATEXT) $(DEBUGLINE) asmerr.c
  129. $(OD)\asmerrtb.obj: asmerrtb.c asm86.h asmmsg.h
  130. $(CC) $(WARN) -u -nologo $(ATEXT) $(D) $(OFF) $(SPCLMODEL) -ND ERRORS -c -Fo$@ asmerrtb.c
  131. $(OD)\asmeval.obj: asmeval.c $(I) asmexpr.h
  132. # Optimize loop was removed because of C 386 bug
  133. # $(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmeval.c
  134. $(COMPILE) $(ATEXT) $(DEBUG) asmeval.c
  135. $(OD)\asmexpr.obj: asmexpr.c $(I) asmexpr.h asmctype.h asmmsg.h
  136. $(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmexpr.c
  137. $(OD)\asmflt.obj: asmflt.c $(I) asmctype.h asmopcod.h
  138. $(COMPILE) $(ATEXT) $(DEBUG) asmflt.c
  139. $(OD)\casmhelp.obj: asmhelp.asm mixed.inc
  140. $(A) -Zi -t -mx -i. -ic:\inc $D -DCPDOS asmhelp,$@;
  141. $(OD)\casminp.obj: asminp.c $(I) asmctype.h asmmsg.h
  142. $(COMPILE) $(ATEXT) $(DEBUGLINE) -DCPDOS asminp.c
  143. $(OD)\asminptb.obj: asminptb.c asm86.h asmdebug.h asmctype.h
  144. $(COMPILE) $(ATEXT) $(DEBUG) asminptb.c
  145. $(OD)\asmirp.obj: asmirp.c $(I) asmctype.h
  146. $(COMPILE) $(OMAX) $(ATEXT) $(DEBUG) asmirp.c
  147. $(OD)\asmlst.obj: asmlst.c $(I) asmctype.h asmmsg.h
  148. $(COMPILE) $(DEBUG) asmlst.c
  149. $(OD)\asmmac.obj: asmmac.c $(I) asmctype.h
  150. $(COMPILE) $(OMAX) $(ATEXT) $(DEBUG) asmmac.c
  151. $(OD)\cmasm.obj: masm.c $(I) asmctype.h asmmsg.h
  152. $(COMPILE) $(DEBUG) -DCPDOS $(RELEASE) masm.c
  153. $(OD)\asmopc.obj: asmopc.c $(I) asmctype.h asmopcod.h
  154. $(COMPILE) $(ATEXT) $(DEBUG) asmopc.c
  155. $(OD)\asmopcod.obj: asmopcod.c $(I)
  156. $(COMPILE) $(ATEXT) $(OLOOP) $(DEBUG) asmopcod.c
  157. $(OD)\asmpars.obj: asmpars.c $(I) asmctype.h
  158. $(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmpars.c
  159. $(OD)\asmrec.obj: asmrec.c $(I) asmctype.h
  160. $(COMPILE) $(ATEXT) $(DEBUG) asmrec.c
  161. $(OD)\asmsym.obj: asmsym.c $(I) asmctype.h asmtab.h
  162. $(COMPILE) $(OMAX) $(ATEXT) $(DEBUG) asmsym.c
  163. $(OD)\asmtab.obj: asmtab.c $(I) asmctype.h asmopcod.h asmtab.h
  164. $(COMPILE) $(ATEXT) $(DEBUGLINE) asmtab.c
  165. # Rules for 386 Specific modules
  166. !IF "$(MASMOS)"=="OS2_2"
  167. $(OD)\msghdr.obj: msghdr.c $(I)
  168. $(COMPILE) $(DEBUG) msghdr.c
  169. !ENDIF
  170. # This is how asmkeys.h was created prior to NT eliminating genkey.exe
  171. #genkey.obj: genkey.c
  172. # $(CC) $(WARN) -Ox -c genkey.c
  173. #
  174. #hash.obj: hash.c
  175. # $(CC) $(WARN) -Ox -c hash.c
  176. #
  177. #genkey.exe: genkey.obj hash.obj
  178. # $(CC) $(WARN) genkey.obj hash.obj $(MODE)
  179. #
  180. #asmkeys.h: genkey.exe asmkeys.src
  181. # genkey $(V386) asmkeys.src $@
  182. $(OD)\asmtabt2.obj: asmtabt2.c asmkeys.h asmtab.h asmindex.h
  183. $(COMPILE) -ND KEYWORDS asmtabt2.c
  184. $(OD)\asmtabtb.obj: asmtabtb.c asm86.h asmopcod.h asmctype.h asmtab.h
  185. $(COMPILE) $(ATEXT) asmtabtb.c
  186. $(OD)\asmutl.obj: asmutl.c $(I) asmctype.h asmmsg.h asmindex.h
  187. $(COMPILE) $(ATEXT) $(OLOOP) $(RELEASE) $(DEBUG) asmutl.c
  188. $(OD)\fmsghdr.obj: fmsghdr.asm version.inc cmacros.inc msdos.inc
  189. $(A) -Zi -t -mx $(AMODEL) fmsghdr,$@;
  190. $(OD)\cui.obj: ui.c asmmsg.h
  191. $(CC) $(WARN) -u $(D) -nologo $(OFF) -DMASM $(CMODEL) $(DEBUG) $(OPT) -Gs -c -Fo$@ -DCPDOS ui.c
  192. #This is how asmmsg.asm was built prior to it's being slimed.
  193. #Note that only the os2.12 version of masm uses asmmsg.asm, the flat
  194. #model versions use asmhdr.c and asmmsg2.h
  195. #$(OD)\asmmsg.asm: asmmsg.txt mkmsg.exe
  196. # mkmsg $(MKMSGFLG) -asm $@ asmmsg.txt
  197. $(OD)\asmmsg.obj: asmmsg.asm
  198. $(A) -t $(AMODEL) asmmsg,$@;
  199. # This is how version was built prior to NT disposing of makev
  200. #$(OD)\version.obj: $(O) $(OD)\masm.obj \
  201. # $(OD)\ui.obj $(MAKEV)
  202. # $(MAKEV) Microsoft (R) Macro Assembler Version 5.NT$(REL) > $(OD)\version.c
  203. # $(CC) $(WARN) -Ox -c -Fo$@ $(OD)\version.c
  204. $(OD)\version.obj: version.c
  205. $(COMPILE) $(ATEXT) $(DEBUG) version.c
  206. # These tools are nolonger used to build the NT version of MASM because
  207. # we need to be able to build on any platform for any platform.
  208. #
  209. !IF 0
  210. #!IF "$(MASMOS)"!="OS2_2"
  211. # make makev build tool
  212. makev.exe: makev.c
  213. $(CC) $(WARN) /c makev.c
  214. link makev.obj,makevp.exe,nul,/NOD slibcep $(LIB)\doscalls;
  215. bind makevp.exe $(LIB)\doscalls.lib -o makev.exe
  216. -del makev.obj
  217. -del makevp.exe
  218. # make mkmsg build tool
  219. mkmsg.exe: mkmsg.c
  220. $(CC) $(WARN) /c mkmsg.c
  221. link mkmsg.obj,mkmsgp.exe,nul,/NOD slibcep $(LIB)\doscalls;
  222. bind mkmsgp.exe $(LIB)\doscalls.lib -o mkmsg.exe
  223. -del mkmsg.obj
  224. -del mkmsgp.exe
  225. !ENDIF