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
22 BINDIR=e:\devel\bcb5\cbuilder5\bin
24 # If "BINDIR=C:\...." has not been defined on the command line
25 # assume that the binary files are in the same directory as the
27 !message ****************************************************
31 !message Path to tools set to $(BINDIR)
34 !message Assuming path to tools to be $(BINDIR)
36 !message You can change this assumption by specifying
37 !message -DBINDIR=C:\my_path
38 !message as a command line paramter for MAKE
40 !message ****************************************************
44 CCFLAGS=-q -Q -tWC -c -O2 -A -w-8057
45 # /q: Suppress compiler identification banner
46 # /Q: Extended compiler error information
47 # /-tWC: Windows console mode application
48 # /c: Compile, do not link
49 # /O2: Optimize for speed
50 # /A: ANSI compatible code only
51 # /-w-8057: Turn off "Parameter <param> never used in function <func>" warning
53 LINK=$(BINDIR)\ilink32
54 LINKFLAGS=/V4.0 /q /x /c /ap /L$(BINDIR)\..\LIB # /L -> default LIB directory
55 # /V4.0: marked as Win95 / NT application in PE header
56 # /q: suppress command-line banner
58 # /c: case sensitive link
59 # /ap: link for 32-bit console application
60 # /L...: path to .lib directory
63 # default libraries for Win32 console applications
64 LIBRARIES=cw32.lib import32.lib
65 # default startup code for Win32 console applications
68 # default extension for our EXE
70 # default extension for OBJ files
74 SUFFIX= w# # by default, this makefile produces nasmw.exe and ndisasmw.exe
77 # Builds C files to OBJ
82 NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
83 assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
84 output/outbin.$(OBJ) output/outaout.$(OBJ) output/outcoff.$(OBJ) output/outelf.$(OBJ) \
85 output/outobj.$(OBJ) output/outas86.$(OBJ) output/outrdf.$(OBJ) output/outdbg.$(OBJ) \
86 output/outrdf2.$(OBJ) output/outieee.$(OBJ) \
87 preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)
89 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
93 BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
97 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
98 $(LINK) $(LINKFLAGS) @&&| #open temp response file
101 # default MAP file name for EXE
103 | # close temp file, first column!
107 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
108 $(LINK) $(LINKFLAGS) @&&| #open temp response file
110 ndisasm$(SUFFIX)$(EXE)
111 # default MAP file name for EXE
113 | # close temp file, first column!
116 # OBJs with dependencies
117 assemble.$(OBJ): assemble.c nasm.h version.h insnsi.h assemble.h insns.h
118 disasm.$(OBJ): disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
119 eval.$(OBJ): eval.c nasm.h version.h insnsi.h nasmlib.h eval.h
120 float.$(OBJ): float.c nasm.h version.h insnsi.h
121 insnsa.$(OBJ): insnsa.c nasm.h version.h insnsi.h insns.h
122 insnsd.$(OBJ): insnsd.c nasm.h version.h insnsi.h insns.h
123 labels.$(OBJ): labels.c nasm.h version.h insnsi.h nasmlib.h
124 listing.$(OBJ): listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
125 nasm.$(OBJ): nasm.c nasm.h version.h insnsi.h nasmlib.h parser.h assemble.h labels.h \
127 nasmlib.$(OBJ): nasmlib.c nasm.h version.h insnsi.h nasmlib.h names.c insnsn.c
128 ndisasm.$(OBJ): ndisasm.c nasm.h version.h insnsi.h sync.h disasm.h
129 output/outas86.$(OBJ): output/outas86.c nasm.h version.h insnsi.h nasmlib.h
130 output/outaout.$(OBJ): output/outaout.c nasm.h version.h insnsi.h nasmlib.h
131 output/outbin.$(OBJ): output/outbin.c nasm.h version.h insnsi.h nasmlib.h
132 output/outcoff.$(OBJ): output/outcoff.c nasm.h version.h insnsi.h nasmlib.h
133 output/outdbg.$(OBJ): output/outdbg.c nasm.h version.h insnsi.h nasmlib.h
134 output/outelf.$(OBJ): output/outelf.c nasm.h version.h insnsi.h nasmlib.h
135 output/outobj.$(OBJ): output/outobj.c nasm.h version.h insnsi.h nasmlib.h
136 output/outrdf2.$(OBJ): output/outrdf2.c nasm.h version.h insnsi.h nasmlib.h
137 output/outieee.$(OBJ): output/outieee.c nasm.h version.h insnsi.h nasmlib.h
138 outform.$(OBJ): outform.c outform.h nasm.h version.h insnsi.h
139 parser.$(OBJ): parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
140 preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h version.h insnsi.h nasmlib.h
141 sync.$(OBJ): sync.c sync.h
143 # These source files are automagically generated from a single
144 # instruction-table file by a Perl script. They're distributed,
145 # though, so it isn't necessary to have Perl just to recompile NASM
146 # from the distribution.
148 insnsa.c: InstructionData
149 insnsd.c: InstructionData
150 insnsi.h: InstructionData
151 insnsn.c: InstructionData
153 InstructionData: insns.dat insns.pl
154 perl $(srcdir)/insns.pl -a $(srcdir)/insns.dat
156 # This source file is generated from the standard macros file
157 # `standard.mac' by another Perl script. Again, it's part of the
158 # standard distribution.
160 macros.c: macros.pl standard.mac version.mac
161 perl $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
163 # These files contains all the standard macros that are derived from
164 # the version number.
165 version.h: version version.pl
166 perl $(srcdir)/version.pl h < $(srcdir)/version > version.h
168 version.mac: version version.pl
169 perl $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
172 @-del /S *.obj 2> NUL 1>&2
173 @-del /S *.il? 2> NUL 1>&2
174 @-del /S *.tds 2> NUL 1>&2
175 @-del /S *.~* 2> NUL 1>&2
176 @-del /S nasm$(SUFFIX)$(EXE) 2> NUL 1>&2
177 @-del /S ndisasm$(SUFFIX)$(EXE) 2> NUL 1>&2