windows-nt/Source/XPSP1/NT/sdktools/masm/makefile.os2

301 lines
8.2 KiB
Plaintext
Raw Normal View History

2020-09-26 03:20:57 -05:00
# dos makefile for masm.exe
# The environment variable MASMOS (MASM Operating System) is used
# to determin whether to build OS2 2.0/32 bit version or a normal
# OS2 1.2 version.
#
!IF "$(MASMOS)"!="OS2_2"
# Setup to build NON OS2 2.0 version of MASM
BUILDTYPE = MSDOS
#Default version to build
OD=OBJ\OS2.12
MVERSION = $(OD)\masm5pi
CC = cl
# memory model for .c sources
CMODEL = -AM
SPCLMODEL = -Alnu
ATEXT = -NT A_TEXT
MKMSGFLG =
OPT = -Owtr
OLOOP = -Ol
OMAX = -Ol
# memory model for .asm sources
AMODEL = -DMEDIUM
!ELSE
# Setup to build OS2 2.0 version of MASM
BUILDTYPE = OS2_2
#Default version to build
OD=OBJ\OS2.20
MVERSION = $(OD)\masm386i
CC = cl386
# memory model for .c sources
CMODEL = -AS
SPCLMODEL = -AS
ATEXT =
MKMSGFLG = -32
OPT = -Od
OLOOP = -Od
OMAX = -Od
# memory model for .asm sources
AMODEL = -DSMALL
# Include directory for 386 floating point code
ID386 = INC386
!ENDIF
A = masm
L = link
L5 = link
L32 = link386
MODE = -Lp
MAKEV = makev.exe
# Release number, comment next two lines out for release version
REL=.01
RELEASE=-DRELEASE=$(REL)
# symbolic debugging support
#DEBUG =
DEBUG = -Zi
#DEBUGLINE = -Zd
DEBUGLINE = -Zi
# 386 support option
V386 =
#V386 = -DNOV386
# kind of optimization; time, size, or none
# C 5.1, OPT = -Oatr
OPT = -Owtr
OLOOP = -Ol
OMAX = -Ol
# Warning level to use
WARN = -W2
# standard cc invocation lines
D = -D$(BUILDTYPE) $(V386) $(O1)
CDEFS = -u $(D) $(CMODEL) $(OPT) -c -nologo $(WARN)
COMPILE = $(CC) $(CDEFS) -Gs -Fo$@
I = asm86.h asmfcn.h asmdebug.h asmconf.h
O = $(OD)\asmalloc.obj $(OD)\asmchksp.obj $(OD)\asmcond.obj\
$(OD)\asmcref.obj $(OD)\asmdata.obj $(OD)\asmdir.obj \
$(OD)\asmemit.obj $(OD)\asmequ.obj $(OD)\asmerr.obj \
$(OD)\asmerrtb.obj $(OD)\asmeval.obj $(OD)\asmexpr.obj \
$(OD)\asmflt.obj $(OD)\asminptb.obj $(OD)\asmirp.obj \
$(OD)\asmlst.obj $(OD)\asmmac.obj $(OD)\asmopc.obj \
$(OD)\asmopcod.obj $(OD)\asmpars.obj $(OD)\asmrec.obj \
$(OD)\asmsym.obj $(OD)\asmtab.obj $(OD)\asmtabt2.obj \
$(OD)\asmtabtb.obj $(OD)\asmutl.obj $(OD)\version.obj \
$(OD)\cmasm.obj $(OD)\cui.obj $(OD)\casminp.obj
OPROT = $(OD)\casmhelp.obj $(OD)\asmmsg.obj
O386 = $(OD)\msghdr.obj
default: $(MVERSION).exe
all: masm5.exe masm5b.exe cref.exe crefb.exe
# When OS2_2 is set a dos version of the assembler can't be built
!IF "$(MASMOS)"!="OS2_2"
$(OD)\masm5p.exe: $(O) $(OPROT)
$(L5) /batch @masm5p.lnk,$(OD)\$(@B).exe,nul,mlibcep doscalls,masm.def;
$(OD)\masm5pi.exe: $(O) $(OPROT)
$(L5) /map /batch /co @masm5p.lnk,$(OD)\$(@B).exe,$(OD)\$(@B).map,mlibcep doscalls,masm.def;
mapsym $(OD)\$(@B).map
copy $(@B).sym $(OD)\$(@B).sym
-del $(@B).sym
$(OD)\masm5b.exe: masm5p.exe
bind $(OD)\masm5p.exe $(LIB)\doscalls.lib $(LIB)\apilmr.obj -o $(OD)\masm.exe
-del $(OD)\masm5b.exe
ren $(OD)\masm.exe $(OD)\masm5b.exe
!ELSE
$(OD)\masm386.exe: $(O) $(OD)\version.obj $(O386)
$(L32) /batch @masm386.lnk,$(OD)\$(@B).exe,nul,libc os2386,masm.def;
$(OD)\masm386i.exe: $(O) $(OD)\version.obj $(O386)
$(L32) /map /batch /co @masm386.lnk,$(OD)\$(@B).exe,$(OD)\$(@B).map,libc os2386,masm.def;
mapsym $(OD)\$(@B).map
copy $(@B).sym $(OD)\$(@B).sym
-del $(@B).sym
!ENDIF
# This is how asmmsg.h was created prior to NT not having mkmsg available
# asmmsg.h: asmmsg.txt
# mkmsg -h $@ asmmsg.txt
$(OD)\asmalloc.obj: asmalloc.c asm86.h
$(COMPILE) $(ATEXT) $(DEBUGLINE) asmalloc.c
$(OD)\asmchksp.obj: asmchksp.c $(I) asmctype.h asmopcod.h asmexpr.h
$(CC) $(CDEFS) $(OLOOP) $(ATEXT) $(DEBUG) -Fo$@ asmchksp.c
$(OD)\asmcond.obj: asmcond.c $(I) asmctype.h
$(COMPILE) $(ATEXT) $(DEBUGLINE) asmcond.c
$(OD)\asmcref.obj: asmcref.c $(I)
$(COMPILE) $(DEBUGLINE) asmcref.c
$(OD)\asmdata.obj: asmdata.c $(I) asmctype.h asmmsg.h
$(COMPILE) $(ATEXT) $(DEBUG) asmdata.c
$(OD)\asmdir.obj: asmdir.c $(I) asmctype.h asmmsg.h
$(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmdir.c
$(OD)\asmemit.obj: asmemit.c $(I)
$(COMPILE) $(ATEXT) $(DEBUG) asmemit.c
$(OD)\asmequ.obj: asmequ.c $(I) asmctype.h asmmsg.h
$(COMPILE) $(ATEXT) $(DEBUG) asmequ.c
$(OD)\asmerr.obj: asmerr.c $(I) asmmsg.h
$(COMPILE) $(ATEXT) $(DEBUGLINE) asmerr.c
$(OD)\asmerrtb.obj: asmerrtb.c asm86.h asmmsg.h
$(CC) $(WARN) -u -nologo $(ATEXT) $(D) $(OFF) $(SPCLMODEL) -ND ERRORS -c -Fo$@ asmerrtb.c
$(OD)\asmeval.obj: asmeval.c $(I) asmexpr.h
# Optimize loop was removed because of C 386 bug
# $(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmeval.c
$(COMPILE) $(ATEXT) $(DEBUG) asmeval.c
$(OD)\asmexpr.obj: asmexpr.c $(I) asmexpr.h asmctype.h asmmsg.h
$(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmexpr.c
$(OD)\asmflt.obj: asmflt.c $(I) asmctype.h asmopcod.h
$(COMPILE) $(ATEXT) $(DEBUG) asmflt.c
$(OD)\casmhelp.obj: asmhelp.asm mixed.inc
$(A) -Zi -t -mx -i. -ic:\inc $D -DCPDOS asmhelp,$@;
$(OD)\casminp.obj: asminp.c $(I) asmctype.h asmmsg.h
$(COMPILE) $(ATEXT) $(DEBUGLINE) -DCPDOS asminp.c
$(OD)\asminptb.obj: asminptb.c asm86.h asmdebug.h asmctype.h
$(COMPILE) $(ATEXT) $(DEBUG) asminptb.c
$(OD)\asmirp.obj: asmirp.c $(I) asmctype.h
$(COMPILE) $(OMAX) $(ATEXT) $(DEBUG) asmirp.c
$(OD)\asmlst.obj: asmlst.c $(I) asmctype.h asmmsg.h
$(COMPILE) $(DEBUG) asmlst.c
$(OD)\asmmac.obj: asmmac.c $(I) asmctype.h
$(COMPILE) $(OMAX) $(ATEXT) $(DEBUG) asmmac.c
$(OD)\cmasm.obj: masm.c $(I) asmctype.h asmmsg.h
$(COMPILE) $(DEBUG) -DCPDOS $(RELEASE) masm.c
$(OD)\asmopc.obj: asmopc.c $(I) asmctype.h asmopcod.h
$(COMPILE) $(ATEXT) $(DEBUG) asmopc.c
$(OD)\asmopcod.obj: asmopcod.c $(I)
$(COMPILE) $(ATEXT) $(OLOOP) $(DEBUG) asmopcod.c
$(OD)\asmpars.obj: asmpars.c $(I) asmctype.h
$(COMPILE) $(OLOOP) $(ATEXT) $(DEBUG) asmpars.c
$(OD)\asmrec.obj: asmrec.c $(I) asmctype.h
$(COMPILE) $(ATEXT) $(DEBUG) asmrec.c
$(OD)\asmsym.obj: asmsym.c $(I) asmctype.h asmtab.h
$(COMPILE) $(OMAX) $(ATEXT) $(DEBUG) asmsym.c
$(OD)\asmtab.obj: asmtab.c $(I) asmctype.h asmopcod.h asmtab.h
$(COMPILE) $(ATEXT) $(DEBUGLINE) asmtab.c
# Rules for 386 Specific modules
!IF "$(MASMOS)"=="OS2_2"
$(OD)\msghdr.obj: msghdr.c $(I)
$(COMPILE) $(DEBUG) msghdr.c
!ENDIF
# This is how asmkeys.h was created prior to NT eliminating genkey.exe
#genkey.obj: genkey.c
# $(CC) $(WARN) -Ox -c genkey.c
#
#hash.obj: hash.c
# $(CC) $(WARN) -Ox -c hash.c
#
#genkey.exe: genkey.obj hash.obj
# $(CC) $(WARN) genkey.obj hash.obj $(MODE)
#
#asmkeys.h: genkey.exe asmkeys.src
# genkey $(V386) asmkeys.src $@
$(OD)\asmtabt2.obj: asmtabt2.c asmkeys.h asmtab.h asmindex.h
$(COMPILE) -ND KEYWORDS asmtabt2.c
$(OD)\asmtabtb.obj: asmtabtb.c asm86.h asmopcod.h asmctype.h asmtab.h
$(COMPILE) $(ATEXT) asmtabtb.c
$(OD)\asmutl.obj: asmutl.c $(I) asmctype.h asmmsg.h asmindex.h
$(COMPILE) $(ATEXT) $(OLOOP) $(RELEASE) $(DEBUG) asmutl.c
$(OD)\fmsghdr.obj: fmsghdr.asm version.inc cmacros.inc msdos.inc
$(A) -Zi -t -mx $(AMODEL) fmsghdr,$@;
$(OD)\cui.obj: ui.c asmmsg.h
$(CC) $(WARN) -u $(D) -nologo $(OFF) -DMASM $(CMODEL) $(DEBUG) $(OPT) -Gs -c -Fo$@ -DCPDOS ui.c
#This is how asmmsg.asm was built prior to it's being slimed.
#Note that only the os2.12 version of masm uses asmmsg.asm, the flat
#model versions use asmhdr.c and asmmsg2.h
#$(OD)\asmmsg.asm: asmmsg.txt mkmsg.exe
# mkmsg $(MKMSGFLG) -asm $@ asmmsg.txt
$(OD)\asmmsg.obj: asmmsg.asm
$(A) -t $(AMODEL) asmmsg,$@;
# This is how version was built prior to NT disposing of makev
#$(OD)\version.obj: $(O) $(OD)\masm.obj \
# $(OD)\ui.obj $(MAKEV)
# $(MAKEV) Microsoft (R) Macro Assembler Version 5.NT$(REL) > $(OD)\version.c
# $(CC) $(WARN) -Ox -c -Fo$@ $(OD)\version.c
$(OD)\version.obj: version.c
$(COMPILE) $(ATEXT) $(DEBUG) version.c
# These tools are nolonger used to build the NT version of MASM because
# we need to be able to build on any platform for any platform.
#
!IF 0
#!IF "$(MASMOS)"!="OS2_2"
# make makev build tool
makev.exe: makev.c
$(CC) $(WARN) /c makev.c
link makev.obj,makevp.exe,nul,/NOD slibcep $(LIB)\doscalls;
bind makevp.exe $(LIB)\doscalls.lib -o makev.exe
-del makev.obj
-del makevp.exe
# make mkmsg build tool
mkmsg.exe: mkmsg.c
$(CC) $(WARN) /c mkmsg.c
link mkmsg.obj,mkmsgp.exe,nul,/NOD slibcep $(LIB)\doscalls;
bind mkmsgp.exe $(LIB)\doscalls.lib -o mkmsg.exe
-del mkmsg.obj
-del mkmsgp.exe
!ENDIF