NASM 0.98.09
[nasm.git] / Mkfiles / Makefile.os2
blob0d99283d2b5d1f0a28b66e27d12dfd327089d1d9
1 # Makefile for the Netwide Assembler under OS/2 (aimed at Borland C++ for OS/2)
3 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
4 # Julian Hall. All rights reserved. The software is
5 # redistributable under the licence given in the file "Licence"
6 # distributed in the NASM archive.
8 # This makefile is made to compile NASMOS2 and NDISASM2
9 # using Borland C++ for OS/2.
11 #-------------------------------------------------------------------
12 #  Make Directives
13 #-------------------------------------------------------------------
14 .AUTODEPEND :
15 .SUFFIXES : .rc .res .obj .c .cpp .asm .hlp .itl .ipf
17 #-------------------------------------------------------------------
18 #  Make Macros
19 #-------------------------------------------------------------------
21 LIBS       = c2 + os2
23 # --------------------------------------------------------------------------
25 #       c  compile only
26 #       v  include full sybolic debugging information
27 #       b  force enums to be of type int
29 # --------------------------------------------------------------------------
31 CCFLAGS = /c /v /b
33 CC = bcc                #compiler
34 LINK = tlink            #linker
36 DCCFLAGS = /d /c /O /A  #compiler flags for NDISASM
37   #/d=merge dupicate strings
38   #/c=compile only
39   #/O=Optimise jumps
40   #/A=ANSI standard C
42 LINKFLAGS = /c /x       #linker flags
43   #/c=case sIgnificance on symbols
44   #/x=No map file at all
46 LIBRARIES =             #any libaries to add, out side of the standard libary
47 EXE = .exe              #executable file extention (keep the . as the start)
48 OBJ = obj               #OBJ file extention
50 NASM_ASM=$(CC) $(CCFLAGS) $&.c         #Command line for NASM
51 DASM_ASM=$(CC) $(DCCFLAGS) $&.c        #command line for NDISASM
53 # NOTE: $& is used to create the file name, as it only gives the name it's
54 # self, where as using $* would have give the full path of the file it
55 # want's done. This becomes a problem if the OBJ files are in a seperate
56 # directory, becuse it will then try to find the source file in the OBJ
57 # dir.
59 ################################################################
60 #The OBJ files that NASM is dependent on
62 NASMOBJS = $(OBJD)nasm.$(OBJ)   $(OBJD)nasmlib.$(OBJ)  $(OBJD)float.$(OBJ)  \
63            $(OBJD)insnsa.$(OBJ) $(OBJD)assemble.$(OBJ) $(OBJD)labels.$(OBJ) \
64            $(OBJD)parser.$(OBJ) $(OBJD)outform.$(OBJ)  $(OBJD)preproc.$(OBJ) \
65            $(OBJD)listing.$(OBJ) $(OBJD)eval.$(OBJ) $(OBJD)outrdf2.$(OBJ) $(OBJD)zoutieee.$(OBJ) 
67 ################################################################
68 #The OBJ files that NDISASM is dependent on
70 NDISASMOBJS = $(OBJD)ndisasm.$(OBJ)  $(OBJD)disasm.$(OBJ) $(OBJD)sync.$(OBJ) \
71               $(OBJD)nasmlibd.$(OBJ) $(OBJD)insnsd.$(OBJ)
73 ################################################################
74 #The OBJ file for the output formats.
76 OUTOBJ= $(OBJD)outbin.$(OBJ) $(OBJD)outaout.$(OBJ) $(OBJD)outcoff.$(OBJ) \
77         $(OBJD)outelf.$(OBJ) $(OBJD)outobj.$(OBJ)  $(OBJD)outas86.$(OBJ) \
78         $(OBJD)outrdf.$(OBJ) $(OBJD)outdbg.$(OBJ)
81 ################################################################
82 # Build everything
84 all : nasmos2$(EXE) ndisasm2$(EXE)
86 ################################################################
87 #NASM, NDISASM compile, I hope it's self explanitory
89 nasmos2$(EXE): $(NASMOBJS) $(OUTOBJ)
90           $(LINK) $(LINKFLAGS) @&&!                     #command for the linker
91           C02 $(NASMOBJS) $(OUTOBJ) #OBJ file list
92           $(EXED)nasmos2$(EXE)                             #EXE file name
93           NASMOS2.MAP 
94           $(LIBS)           #Libaries needed
95           NASMOS2.DEF                                   #Link Definition file
98 ndisasm2$(EXE): $(NDISASMOBJS)
99         $(LINK) $(LINKFLAGS) @&&!              #command for the linker
100         c02.obj $(NDISASMOBJS)           #OBJ file list
101         $(EXED)ndisasm2$(EXE)                   #EXE file name
102         NDISAMS2.MAP 
103         $(LIBS) $(LIBRARIES)              #Libaries needed
106 ################################################################
107 # Dependencies for all of NASM's obj files
109 $(OBJD)assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h
110         $(NASM_ASM)
112 $(OBJD)float.$(OBJ): float.c nasm.h
113         $(NASM_ASM)
115 $(OBJD)labels.$(OBJ): labels.c nasm.h nasmlib.h
116         $(NASM_ASM)
118 $(OBJD)listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h
119         $(NASM_ASM)
121 $(OBJD)eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h
122         $(NASM_ASM)
124 $(OBJD)nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \
125                 listing.h outform.h
126         $(NASM_ASM)
128 $(OBJD)nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h names.c insnsn.c
129         $(NASM_ASM)
131 $(OBJD)parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c
132         $(NASM_ASM)
134 $(OBJD)preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h
135         $(NASM_ASM)
137 $(OBJD)insnsa.$(OBJ): insnsa.c nasm.h insns.h
138         $(NASM_ASM)
140 ################################################################
141 # Dependencies for all of NDISASM's obj files
143 $(OBJD)disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c
144         $(DASM_ASM)
146 $(OBJD)ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h
147         $(DASM_ASM)
149 $(OBJD)sync.$(OBJ): sync.c sync.h
150         $(DASM_ASM)
152 $(OBJD)insnsd.$(OBJ): insnsd.c nasm.h insns.h
153         $(DASM_ASM)
155 # This is a kludge from the word go, as we can't use the nasmlib.obj compiled
156 # for NASM, as it's could be the wrong model size, so we have to compile it
157 # again as huge to make sure.
159 # So as not to overwrite the nasmlib.obj for NASM (if it did, that
160 # could cause all kinds of problems) it compiles it into nasmlibd.obj.
162 # the -o... switch tells it the name to compile the obj file to, right here
163 # $(OBJD)nasmlibd.obj
165 $(OBJD)nasmlibd.$(OBJ): nasmlib.c nasm.h nasmlib.h
166         $(CC) $(DCCFLAGS) -o$(OBJD)nasmlibd.obj nasmlib.c
168 ################################################################
169 # Dependencies for all of the output format's OBJ files
171 $(OBJD)outas86.$(OBJ): outas86.c nasm.h nasmlib.h
172         $(NASM_ASM)
174 $(OBJD)outaout.$(OBJ): outaout.c nasm.h nasmlib.h
175         $(NASM_ASM)
177 $(OBJD)outbin.$(OBJ): outbin.c nasm.h nasmlib.h
178         $(NASM_ASM)
180 $(OBJD)outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h
181         $(NASM_ASM)
183 $(OBJD)outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h
184         $(NASM_ASM)
186 $(OBJD)outelf.$(OBJ): outelf.c nasm.h nasmlib.h
187         $(NASM_ASM)
189 $(OBJD)outobj.$(OBJ): outobj.c nasm.h nasmlib.h
190         $(NASM_ASM)
192 $(OBJD)outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h
193         $(NASM_ASM)
195 $(OBJD)outform.$(OBJ): outform.c outform.h nasm.h
196         $(NASM_ASM)
198 ################################################################
199 # A quick way to delete the OBJ files as well as the binaries.
201 clean :
202         del $(OBJD)*.obj
203         del nasmos2$(EXE)
204         del ndisasm2$(EXE)
206 # Makefile created by Chuck Crayne <ccrayne@pacific.net> --05/4/99
207 # Based on Makefile.bc2 by Fox Cutter <lmb@comtch.iea.com> --01/27/97