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 #-------------------------------------------------------------------
13 #-------------------------------------------------------------------
15 .SUFFIXES : .rc .res .obj .c .cpp .asm .hlp .itl .ipf
17 #-------------------------------------------------------------------
19 #-------------------------------------------------------------------
23 # --------------------------------------------------------------------------
26 # v include full sybolic debugging information
27 # b force enums to be of type int
29 # --------------------------------------------------------------------------
36 DCCFLAGS = /d /c /O /A #compiler flags for NDISASM
37 #/d=merge dupicate strings
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
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 ################################################################
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
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
103 $(LIBS) $(LIBRARIES) #Libaries needed
106 ################################################################
107 # Dependencies for all of NASM's obj files
109 $(OBJD)assemble.$(OBJ): assemble.c nasm.h version.h assemble.h insns.h
112 $(OBJD)float.$(OBJ): float.c nasm.h version.h
115 $(OBJD)labels.$(OBJ): labels.c nasm.h version.h nasmlib.h
118 $(OBJD)listing.$(OBJ): listing.c nasm.h version.h nasmlib.h listing.h
121 $(OBJD)eval.$(OBJ): eval.c nasm.h version.h nasmlib.h eval.h
124 $(OBJD)nasm.$(OBJ): nasm.c nasm.h version.h nasmlib.h parser.h assemble.h labels.h \
128 $(OBJD)nasmlib.$(OBJ): nasmlib.c nasm.h version.h nasmlib.h names.c insnsn.c
131 $(OBJD)parser.$(OBJ): parser.c nasm.h version.h nasmlib.h parser.h float.h names.c
134 $(OBJD)preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h version.h nasmlib.h
137 $(OBJD)insnsa.$(OBJ): insnsa.c nasm.h version.h insns.h
140 ################################################################
141 # Dependencies for all of NDISASM's obj files
143 $(OBJD)disasm.$(OBJ): disasm.c nasm.h version.h disasm.h sync.h insns.h names.c
146 $(OBJD)ndisasm.$(OBJ): ndisasm.c nasm.h version.h sync.h disasm.h
149 $(OBJD)sync.$(OBJ): sync.c sync.h
152 $(OBJD)insnsd.$(OBJ): insnsd.c nasm.h version.h insns.h
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 version.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): output/outas86.c nasm.h version.h nasmlib.h
174 $(OBJD)outaout.$(OBJ): output/outaout.c nasm.h version.h nasmlib.h
177 $(OBJD)outbin.$(OBJ): output/outbin.c nasm.h version.h nasmlib.h
180 $(OBJD)outcoff.$(OBJ): output/outcoff.c nasm.h version.h nasmlib.h
183 $(OBJD)outdbg.$(OBJ): output/outdbg.c nasm.h version.h nasmlib.h
186 $(OBJD)outelf.$(OBJ): output/outelf.c nasm.h version.h nasmlib.h
189 $(OBJD)outobj.$(OBJ): output/outobj.c nasm.h version.h nasmlib.h
192 $(OBJD)outform.$(OBJ): outform.c outform.h nasm.h version.h
195 ################################################################
196 # A quick way to delete the OBJ files as well as the binaries.
203 # Makefile created by Chuck Crayne <ccrayne@pacific.net> --05/4/99
204 # Based on Makefile.bc2 by Fox Cutter <lmb@comtch.iea.com> --01/27/97