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 -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 # /-w-8057: Turn off "Parameter <param> never used in function <func>" warning
55 LINK=$(BINDIR)\ilink32
56 LINKFLAGS=/V4.0 /q /x /c /ap /L$(BINDIR)\..\LIB # /L -> default LIB directory
57 # /V4.0: marked as Win95 / NT application in PE header
58 # /q: suppress command-line banner
60 # /c: case sensitive link
61 # /ap: link for 32-bit console application
62 # /L...: path to .lib directory
65 # default libraries for Win32 console applications
66 LIBRARIES=cw32.lib import32.lib
67 # default startup code for Win32 console applications
70 # default extension for our EXE
72 # default extension for OBJ files
76 SUFFIX= w# # by default, this makefile produces nasmw.exe and ndisasmw.exe
79 # Builds C files to OBJ
84 NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
85 assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
86 output/outbin.$(OBJ) output/outaout.$(OBJ) output/outcoff.$(OBJ) output/outelf.$(OBJ) \
87 output/outobj.$(OBJ) output/outas86.$(OBJ) output/outrdf.$(OBJ) output/outdbg.$(OBJ) \
88 output/outrdf2.$(OBJ) output/outieee.$(OBJ) \
89 preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)
91 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
95 BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
99 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
100 $(LINK) $(LINKFLAGS) @&&| #open temp response file
103 # default MAP file name for EXE
105 | # close temp file, first column!
109 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
110 $(LINK) $(LINKFLAGS) @&&| #open temp response file
112 ndisasm$(SUFFIX)$(EXE)
113 # default MAP file name for EXE
115 | # close temp file, first column!
117 # These source files are automagically generated from a single
118 # instruction-table file by a Perl script. They're distributed,
119 # though, so it isn't necessary to have Perl just to recompile NASM
120 # from the distribution.
122 insnsa.c: insns.dat insns.pl
123 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
125 insnsd.c: insns.dat insns.pl
126 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
128 insnsi.h: insns.dat insns.pl
129 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
131 insnsn.c: insns.dat insns.pl
132 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
134 # This source file is generated from the standard macros file
135 # `standard.mac' by another Perl script. Again, it's part of the
136 # standard distribution.
138 macros.c: macros.pl standard.mac version.mac
139 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
141 # These files contains all the standard macros that are derived from
142 # the version number.
143 version.h: version version.pl
144 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
146 version.mac: version version.pl
147 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
149 # These source files are generated from regs.dat by yet another
151 regs.c: regs.dat regs.pl
152 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
153 regflags.c: regs.dat regs.pl
154 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
155 regdis.c: regs.dat regs.pl
156 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
157 regvals.c: regs.dat regs.pl
158 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
159 regs.h: regs.dat regs.pl
160 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
163 @-del /S *.obj 2> NUL 1>&2
164 @-del /S *.il? 2> NUL 1>&2
165 @-del /S *.tds 2> NUL 1>&2
166 @-del /S *.~* 2> NUL 1>&2
167 @-del /S nasm$(SUFFIX)$(EXE) 2> NUL 1>&2
168 @-del /S ndisasm$(SUFFIX)$(EXE) 2> NUL 1>&2
170 #-- Magic hints to mkdep.pl --#
171 # @object-ending: ".$(OBJ)"
172 # @path-separator: "/" # Is this really right? -hpa
173 #-- Everything below is generated by mkdep.pl - do not edit --#
174 assemble.$(OBJ): assemble.c insns.h assemble.h regvals.c nasm.h regs.h \
175 insnsi.h nasmlib.h version.h
176 disasm.$(OBJ): disasm.c insns.h regs.c sync.h names.c nasm.h disasm.h regs.h \
177 insnsn.c insnsi.h version.h regdis.c
178 eval.$(OBJ): eval.c nasm.h regs.h labels.h nasmlib.h version.h eval.h
179 float.$(OBJ): float.c nasm.h regs.h version.h
180 insnsa.$(OBJ): insnsa.c insns.h nasm.h regs.h insnsi.h version.h
181 insnsd.$(OBJ): insnsd.c insns.h nasm.h regs.h insnsi.h version.h
182 insnsn.$(OBJ): insnsn.c
183 labels.$(OBJ): labels.c nasm.h regs.h nasmlib.h version.h
184 listing.$(OBJ): listing.c listing.h nasm.h regs.h nasmlib.h version.h
185 macros.$(OBJ): macros.c
186 names.$(OBJ): names.c regs.c insnsn.c
187 nasm.$(OBJ): nasm.c listing.h preproc.h insns.h outform.h assemble.h \
188 parser.h nasm.h regs.h labels.h insnsi.h nasmlib.h version.h eval.h
189 nasmlib.$(OBJ): nasmlib.c insns.h regs.c names.c nasm.h regs.h insnsn.c \
190 insnsi.h nasmlib.h version.h
191 ndisasm.$(OBJ): ndisasm.c insns.h sync.h nasm.h disasm.h regs.h insnsi.h \
193 outform.$(OBJ): outform.c outform.h nasm.h regs.h version.h
194 output/outaout.$(OBJ): output/outaout.c outform.h nasm.h regs.h nasmlib.h \
196 output/outas86.$(OBJ): output/outas86.c outform.h nasm.h regs.h nasmlib.h \
198 output/outbin.$(OBJ): output/outbin.c outform.h nasm.h regs.h nasmlib.h \
200 output/outcoff.$(OBJ): output/outcoff.c outform.h nasm.h regs.h nasmlib.h \
202 output/outdbg.$(OBJ): output/outdbg.c outform.h nasm.h regs.h nasmlib.h \
204 output/outelf.$(OBJ): output/outelf.c outform.h nasm.h regs.h nasmlib.h \
206 output/outieee.$(OBJ): output/outieee.c outform.h nasm.h regs.h nasmlib.h \
208 output/outobj.$(OBJ): output/outobj.c outform.h nasm.h regs.h nasmlib.h \
210 output/outrdf.$(OBJ): output/outrdf.c outform.h nasm.h regs.h nasmlib.h \
212 output/outrdf2.$(OBJ): output/outrdf2.c outform.h nasm.h regs.h nasmlib.h \
214 parser.$(OBJ): parser.c insns.h parser.h nasm.h regs.h insnsi.h regflags.c \
215 float.h nasmlib.h version.h
216 preproc.$(OBJ): preproc.c nasm.h macros.c regs.h nasmlib.h version.h
217 regdis.$(OBJ): regdis.c
218 regflags.$(OBJ): regflags.c
220 regvals.$(OBJ): regvals.c
221 sync.$(OBJ): sync.c sync.h