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) output\outelf.$(OBJ) \
88 output\outobj.$(OBJ) output\outas86.$(OBJ) output\outrdf.$(OBJ) output\outdbg.$(OBJ) \
89 output\outrdf2.$(OBJ) output\outieee.$(OBJ) \
90 preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)
92 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
96 BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
100 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
101 $(LINK) $(LINKFLAGS) @&&| #open temp response file
104 # default MAP file name for EXE
106 | # close temp file, first column!
110 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
111 $(LINK) $(LINKFLAGS) @&&| #open temp response file
113 ndisasm$(SUFFIX)$(EXE)
114 # default MAP file name for EXE
116 | # close temp file, first column!
118 # These source files are automagically generated from a single
119 # instruction-table file by a Perl script. They're distributed,
120 # though, so it isn't necessary to have Perl just to recompile NASM
121 # from the distribution.
123 insnsa.c: insns.dat insns.pl
124 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
126 insnsd.c: insns.dat insns.pl
127 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
129 insnsi.h: insns.dat insns.pl
130 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
132 insnsn.c: insns.dat insns.pl
133 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
135 # This source file is generated from the standard macros file
136 # `standard.mac' by another Perl script. Again, it's part of the
137 # standard distribution.
139 macros.c: macros.pl standard.mac version.mac
140 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
142 # These files contains all the standard macros that are derived from
143 # the version number.
144 version.h: version version.pl
145 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
147 version.mac: version version.pl
148 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
150 # These source files are generated from regs.dat by yet another
152 regs.c: regs.dat regs.pl
153 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
154 regflags.c: regs.dat regs.pl
155 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
156 regdis.c: regs.dat regs.pl
157 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
158 regvals.c: regs.dat regs.pl
159 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
160 regs.h: regs.dat regs.pl
161 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
164 @-del /S *.obj 2> NUL 1>&2
165 @-del /S *.il? 2> NUL 1>&2
166 @-del /S *.tds 2> NUL 1>&2
167 @-del /S *.~* 2> NUL 1>&2
168 @-del /S nasm$(SUFFIX)$(EXE) 2> NUL 1>&2
169 @-del /S ndisasm$(SUFFIX)$(EXE) 2> NUL 1>&2
171 #-- Magic hints to mkdep.pl --#
172 # @object-ending: ".$(OBJ)"
173 # @path-separator: "\"
174 #-- Everything below is generated by mkdep.pl - do not edit --#
175 assemble.$(OBJ): assemble.c preproc.h insns.h regs.h version.h nasmlib.h \
176 nasm.h regvals.c insnsi.h assemble.h
177 disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h regs.c version.h \
178 nasm.h insnsn.c names.c insnsi.h disasm.h
179 eval.$(OBJ): eval.c labels.h eval.h regs.h version.h nasmlib.h nasm.h
180 float.$(OBJ): float.c regs.h version.h nasm.h
181 insnsa.$(OBJ): insnsa.c insns.h regs.h version.h nasm.h insnsi.h
182 insnsd.$(OBJ): insnsd.c insns.h regs.h version.h nasm.h insnsi.h
183 insnsn.$(OBJ): insnsn.c
184 labels.$(OBJ): labels.c regs.h version.h nasmlib.h nasm.h
185 listing.$(OBJ): listing.c regs.h version.h nasmlib.h nasm.h listing.h
186 macros.$(OBJ): macros.c
187 names.$(OBJ): names.c regs.c insnsn.c
188 nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
189 outform.h version.h nasmlib.h nasm.h assemble.h insnsi.h listing.h
190 nasmlib.$(OBJ): nasmlib.c insns.h regs.h regs.c version.h nasmlib.h nasm.h \
191 insnsn.c names.c insnsi.h
192 ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h version.h nasmlib.h nasm.h \
194 outform.$(OBJ): outform.c regs.h outform.h version.h nasm.h
195 output\outaout.$(OBJ): output\outaout.c regs.h outform.h version.h nasmlib.h \
197 output\outas86.$(OBJ): output\outas86.c regs.h outform.h version.h nasmlib.h \
199 output\outbin.$(OBJ): output\outbin.c labels.h eval.h regs.h outform.h \
200 version.h nasmlib.h nasm.h
201 output\outcoff.$(OBJ): output\outcoff.c regs.h outform.h version.h nasmlib.h \
203 output\outdbg.$(OBJ): output\outdbg.c regs.h outform.h version.h nasmlib.h \
205 output\outelf.$(OBJ): output\outelf.c regs.h outform.h version.h nasmlib.h \
207 output\outieee.$(OBJ): output\outieee.c regs.h outform.h version.h nasmlib.h \
209 output\outobj.$(OBJ): output\outobj.c regs.h outform.h version.h nasmlib.h \
211 output\outrdf.$(OBJ): output\outrdf.c regs.h outform.h version.h nasmlib.h \
213 output\outrdf2.$(OBJ): output\outrdf2.c rdoff\rdoff.h regs.h outform.h \
214 version.h nasmlib.h nasm.h
215 parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c version.h \
216 nasmlib.h nasm.h insnsi.h
217 preproc.$(OBJ): preproc.c macros.c regs.h version.h nasmlib.h nasm.h
218 regdis.$(OBJ): regdis.c
219 regflags.$(OBJ): regflags.c
221 regvals.$(OBJ): regvals.c
222 sync.$(OBJ): sync.c sync.h