1 # Makefile for the Netwide Assembler under 32 bit NT console
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 designed to build NASM with the latest
9 # version of Borland C++Builder and has been tested with
10 # Borland C++ 5.5 (Borland C++Builder 5.0) in combination
13 # Additionally, the free Borland C++ Compiler 5.5 is supported;
16 # http://www.borland.com/bcppbuilder/freecompiler/
18 # MAKEFILE is maintained by Stefan.Hoffmeister@Econos.de
24 #BINDIR=e:\devel\bcb5\cbuilder5\bin
26 # If "BINDIR=C:\...." has not been defined on the command line
27 # assume that the binary files are in the same directory as the
29 !message ****************************************************
33 !message Path to tools set to $(BINDIR)
36 !message Assuming path to tools to be $(BINDIR)
38 !message You can change this assumption by specifying
39 !message -DBINDIR=C:\my_path
40 !message as a command line paramter for MAKE
42 !message ****************************************************
46 CCFLAGS=-q -Q -tWC -c -O2 -A -d -w-8057
47 # /q: Suppress compiler identification banner
48 # /Q: Extended compiler error information
49 # /-tWC: Windows console mode application
50 # /c: Compile, do not link
51 # /O2: Optimize for speed
52 # /A: ANSI compatible code only
53 # /d: Merge duplicate strings
54 # /-w-8057: Turn off "Parameter <param> never used in function <func>" warning
56 LINK=$(BINDIR)\ilink32
57 LINKFLAGS=/V4.0 /q /x /c /ap /L$(BINDIR)\..\LIB # /L -> default LIB directory
58 # /V4.0: marked as Win95 / NT application in PE header
59 # /q: suppress command-line banner
61 # /c: case sensitive link
62 # /ap: link for 32-bit console application
63 # /L...: path to .lib directory
66 # default libraries for Win32 console applications
67 LIBRARIES=cw32.lib import32.lib
68 # default startup code for Win32 console applications
71 # default extension for our EXE
73 # default extension for OBJ files
77 SUFFIX= w# # by default, this makefile produces nasmw.exe and ndisasmw.exe
80 # Builds C files to OBJ
85 NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
86 assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
87 output\outbin.$(OBJ) output\outaout.$(OBJ) output\outcoff.$(OBJ) \
88 output\outelf32.$(OBJ) output\outelf64.$(OBJ) \
89 output\outobj.$(OBJ) output\outas86.$(OBJ) output\outrdf.$(OBJ) output\outdbg.$(OBJ) \
90 output\outrdf2.$(OBJ) output\outieee.$(OBJ) \
91 preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)
93 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
97 BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
101 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
102 $(LINK) $(LINKFLAGS) @&&| #open temp response file
105 # default MAP file name for EXE
107 | # close temp file, first column!
111 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
112 $(LINK) $(LINKFLAGS) @&&| #open temp response file
114 ndisasm$(SUFFIX)$(EXE)
115 # default MAP file name for EXE
117 | # close temp file, first column!
119 # These source files are automagically generated from a single
120 # instruction-table file by a Perl script. They're distributed,
121 # though, so it isn't necessary to have Perl just to recompile NASM
122 # from the distribution.
124 insnsa.c: insns.dat insns.pl
125 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
127 insnsd.c: insns.dat insns.pl
128 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
130 insnsi.h: insns.dat insns.pl
131 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
133 insnsn.c: insns.dat insns.pl
134 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
136 # This source file is generated from the standard macros file
137 # `standard.mac' by another Perl script. Again, it's part of the
138 # standard distribution.
140 macros.c: macros.pl standard.mac version.mac
141 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
143 # These files contains all the standard macros that are derived from
144 # the version number.
145 version.h: version version.pl
146 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
148 version.mac: version version.pl
149 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
151 # These source files are generated from regs.dat by yet another
153 regs.c: regs.dat regs.pl
154 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
155 regflags.c: regs.dat regs.pl
156 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
157 regdis.c: regs.dat regs.pl
158 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
159 regvals.c: regs.dat regs.pl
160 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
161 regs.h: regs.dat regs.pl
162 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
165 @-del /S *.obj 2> NUL 1>&2
166 @-del /S *.il? 2> NUL 1>&2
167 @-del /S *.tds 2> NUL 1>&2
168 @-del /S *.~* 2> NUL 1>&2
169 @-del /S nasm$(SUFFIX)$(EXE) 2> NUL 1>&2
170 @-del /S ndisasm$(SUFFIX)$(EXE) 2> NUL 1>&2
172 #-- Magic hints to mkdep.pl --#
173 # @object-ending: ".$(OBJ)"
174 # @path-separator: "\"
175 #-- Everything below is generated by mkdep.pl - do not edit --#
176 assemble.$(OBJ): assemble.c preproc.h insns.h regs.h regflags.c config.h \
177 version.h nasmlib.h nasm.h regvals.c insnsi.h assemble.h
178 disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
179 version.h nasm.h insnsn.c names.c insnsi.h disasm.h
180 eval.$(OBJ): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h \
182 float.$(OBJ): float.c regs.h config.h version.h nasm.h
183 insnsa.$(OBJ): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
184 insnsd.$(OBJ): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
185 insnsn.$(OBJ): insnsn.c
186 labels.$(OBJ): labels.c regs.h config.h version.h nasmlib.h nasm.h
187 listing.$(OBJ): listing.c regs.h config.h version.h nasmlib.h nasm.h \
189 macros.$(OBJ): macros.c
190 names.$(OBJ): names.c regs.c insnsn.c
191 nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
192 outform.h config.h version.h nasmlib.h nasm.h stdscan.h assemble.h insnsi.h \
194 nasmlib.$(OBJ): nasmlib.c insns.h regs.h config.h regs.c version.h nasmlib.h \
195 nasm.h insnsn.c names.c insnsi.h
196 ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
197 nasm.h insnsi.h disasm.h
198 outform.$(OBJ): outform.c regs.h config.h outform.h version.h nasm.h
199 output\outaout.$(OBJ): output\outaout.c regs.h outform.h config.h version.h \
200 nasmlib.h nasm.h stdscan.h
201 output\outas86.$(OBJ): output\outas86.c regs.h outform.h config.h version.h \
203 output\outbin.$(OBJ): output\outbin.c labels.h eval.h regs.h outform.h \
204 config.h version.h nasmlib.h nasm.h stdscan.h
205 output\outcoff.$(OBJ): output\outcoff.c regs.h outform.h config.h version.h \
207 output\outdbg.$(OBJ): output\outdbg.c regs.h outform.h config.h version.h \
209 output\outelf32.$(OBJ): output\outelf32.c regs.h outform.h config.h \
210 version.h nasmlib.h nasm.h stdscan.h
211 output\outelf64.$(OBJ): output\outelf64.c regs.h outform.h config.h \
212 version.h nasmlib.h nasm.h stdscan.h
213 output\outieee.$(OBJ): output\outieee.c regs.h outform.h config.h version.h \
215 output\outmacho.$(OBJ): output\outmacho.c compiler.h regs.h outform.h \
216 config.h version.h nasmlib.h nasm.h
217 output\outobj.$(OBJ): output\outobj.c regs.h outform.h config.h version.h \
218 nasmlib.h nasm.h stdscan.h
219 output\outrdf.$(OBJ): output\outrdf.c regs.h outform.h config.h version.h \
221 output\outrdf2.$(OBJ): output\outrdf2.c rdoff\rdoff.h regs.h outform.h \
222 config.h version.h nasmlib.h nasm.h
223 parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
224 version.h nasmlib.h nasm.h stdscan.h insnsi.h
225 preproc.$(OBJ): preproc.c macros.c regs.h config.h version.h nasmlib.h \
227 regdis.$(OBJ): regdis.c
228 regflags.$(OBJ): regflags.c
230 regvals.$(OBJ): regvals.c
231 stdscan.$(OBJ): stdscan.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
233 sync.$(OBJ): sync.c sync.h
234 tokhash.$(OBJ): tokhash.c insns.h regs.h config.h version.h nasm.h insnsi.h