fixed multiple %ROTATE bugs (numbers 560567 and 560930) and changed
[nasm.git] / Mkfiles / Makefile.b32
blob7fe78fa515307b1689fad6496ab0bf445de32f56
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
11 # Borland MAKE 5.2
13 # Additionally, the free Borland C++ Compiler 5.5 is supported;
14 # see
16 #   http://www.borland.com/bcppbuilder/freecompiler/
18 # MAKEFILE is maintained by Stefan.Hoffmeister@Econos.de
21 PERL=perl
23 srcdir=.
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
28 # MAKE utility
29 !message ****************************************************
30 !message Note:
31 !message -----
32 !if $d(BINDIR)
33   !message Path to tools set to $(BINDIR)
34 !else
35   BINDIR=$(MAKEDIR)
36   !message Assuming path to tools to be $(BINDIR)
37   !message
38   !message You can change this assumption by specifying
39   !message   -DBINDIR=C:\my_path
40   !message as a command line paramter for MAKE
41 !endif
42 !message ****************************************************
45 CC=$(BINDIR)\bcc32
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
59   # /x:    no map file
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
68 STARTUP=c0x32.obj
70 # default extension for our EXE
71 EXE=.exe
72 # default extension for OBJ files
73 OBJ=obj
76 SUFFIX= w#       # by default, this makefile produces nasmw.exe and ndisasmw.exe
79 # Builds C files to OBJ
80 .c.$(OBJ):
81   $(CC) $(CCFLAGS) $*.c
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) \
92               insnsd.$(OBJ)
95 BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
98 # NASM
99 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
100   $(LINK) $(LINKFLAGS) @&&|     #open temp response file
101     $(STARTUP) $**
102     nasm$(SUFFIX)$(EXE)
103     # default MAP file name for EXE
104     $(LIBRARIES)
105 |                                # close temp file, first column!
108 # NDISASM
109 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
110   $(LINK) $(LINKFLAGS) @&&|     #open temp response file
111     $(STARTUP) $**
112     ndisasm$(SUFFIX)$(EXE)
113     # default MAP file name for EXE
114     $(LIBRARIES)
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
150 # perl script.
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
162 clean:
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 insnsi.h nasmlib.h version.h \
179  eval.h
180 float.$(OBJ): float.c nasm.h regs.h insnsi.h version.h
181 insnsa.$(OBJ): insnsa.c insns.h nasm.h regs.h insnsi.h version.h
182 insnsd.$(OBJ): insnsd.c insns.h nasm.h regs.h insnsi.h version.h
183 insnsn.$(OBJ): insnsn.c
184 labels.$(OBJ): labels.c nasm.h regs.h insnsi.h nasmlib.h version.h
185 listing.$(OBJ): listing.c listing.h nasm.h regs.h insnsi.h nasmlib.h \
186  version.h
187 macros.$(OBJ): macros.c
188 names.$(OBJ): names.c regs.c insnsn.c
189 nasm.$(OBJ): nasm.c listing.h preproc.h insns.h outform.h assemble.h \
190  parser.h nasm.h regs.h labels.h insnsi.h nasmlib.h version.h eval.h
191 nasmlib.$(OBJ): nasmlib.c regs.c names.c nasm.h regs.h insnsn.c insnsi.h \
192  nasmlib.h version.h
193 ndisasm.$(OBJ): ndisasm.c insns.h sync.h nasm.h disasm.h regs.h insnsi.h \
194  nasmlib.h version.h
195 outform.$(OBJ): outform.c outform.h nasm.h regs.h insnsi.h version.h
196 output/outaout.$(OBJ): output/outaout.c outform.h nasm.h regs.h insnsi.h \
197  nasmlib.h version.h
198 output/outas86.$(OBJ): output/outas86.c outform.h nasm.h regs.h insnsi.h \
199  nasmlib.h version.h
200 output/outbin.$(OBJ): output/outbin.c outform.h nasm.h regs.h insnsi.h \
201  nasmlib.h version.h
202 output/outcoff.$(OBJ): output/outcoff.c outform.h nasm.h regs.h insnsi.h \
203  nasmlib.h version.h
204 output/outdbg.$(OBJ): output/outdbg.c outform.h nasm.h regs.h insnsi.h \
205  nasmlib.h version.h
206 output/outelf.$(OBJ): output/outelf.c outform.h nasm.h regs.h insnsi.h \
207  nasmlib.h version.h
208 output/outieee.$(OBJ): output/outieee.c outform.h nasm.h regs.h insnsi.h \
209  nasmlib.h version.h
210 output/outobj.$(OBJ): output/outobj.c outform.h nasm.h regs.h insnsi.h \
211  nasmlib.h version.h
212 output/outrdf.$(OBJ): output/outrdf.c outform.h nasm.h regs.h insnsi.h \
213  nasmlib.h version.h
214 output/outrdf2.$(OBJ): output/outrdf2.c outform.h nasm.h regs.h insnsi.h \
215  nasmlib.h version.h
216 parser.$(OBJ): parser.c parser.h nasm.h regs.h insnsi.h regflags.c float.h \
217  nasmlib.h version.h
218 preproc.$(OBJ): preproc.c nasm.h macros.c regs.h insnsi.h nasmlib.h \
219  version.h
220 regdis.$(OBJ): regdis.c
221 regflags.$(OBJ): regflags.c
222 regs.$(OBJ): regs.c
223 regvals.$(OBJ): regvals.c
224 sync.$(OBJ): sync.c sync.h