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 outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) outelf.$(OBJ) \
85 outobj.$(OBJ) outas86.$(OBJ) outrdf.$(OBJ) outdbg.$(OBJ) \
86 outrdf2.$(OBJ) zoutieee.$(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 insnsi.h assemble.h insns.h
118 disasm.$(OBJ): disasm.c nasm.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
119 eval.$(OBJ): eval.c nasm.h insnsi.h nasmlib.h eval.h
120 float.$(OBJ): float.c nasm.h insnsi.h
121 insnsa.$(OBJ): insnsa.c nasm.h insnsi.h insns.h
122 insnsd.$(OBJ): insnsd.c nasm.h insnsi.h insns.h
123 labels.$(OBJ): labels.c nasm.h insnsi.h nasmlib.h
124 listing.$(OBJ): listing.c nasm.h insnsi.h nasmlib.h listing.h
125 nasm.$(OBJ): nasm.c nasm.h insnsi.h nasmlib.h parser.h assemble.h labels.h \
127 nasmlib.$(OBJ): nasmlib.c nasm.h insnsi.h nasmlib.h names.c insnsn.c
128 ndisasm.$(OBJ): ndisasm.c nasm.h insnsi.h sync.h disasm.h
129 outas86.$(OBJ): outas86.c nasm.h insnsi.h nasmlib.h
130 outaout.$(OBJ): outaout.c nasm.h insnsi.h nasmlib.h
131 outbin.$(OBJ): outbin.c nasm.h insnsi.h nasmlib.h
132 outcoff.$(OBJ): outcoff.c nasm.h insnsi.h nasmlib.h
133 outdbg.$(OBJ): outdbg.c nasm.h insnsi.h nasmlib.h
134 outelf.$(OBJ): outelf.c nasm.h insnsi.h nasmlib.h
135 outobj.$(OBJ): outobj.c nasm.h insnsi.h nasmlib.h
136 outrdf.$(OBJ): outrdf.c nasm.h insnsi.h nasmlib.h
137 outrdf2.$(OBJ): outrdf2.c nasm.h insnsi.h nasmlib.h
138 zoutieee.$(OBJ): zoutieee.c nasm.h insnsi.h nasmlib.h
139 outform.$(OBJ): outform.c outform.h nasm.h insnsi.h
140 parser.$(OBJ): parser.c nasm.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
141 preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h insnsi.h nasmlib.h
142 sync.$(OBJ): sync.c sync.h
144 # These source files are automagically generated from a single
145 # instruction-table file by a Perl script. They're distributed,
146 # though, so it isn't necessary to have Perl just to recompile NASM
147 # from the distribution.
149 insnsa.c: InstructionData
150 insnsd.c: InstructionData
151 insnsi.h: InstructionData
152 insnsn.c: InstructionData
154 InstructionData: insns.dat insns.pl
155 perl $(srcdir)/insns.pl -a $(srcdir)/insns.dat
157 # This source file is generated from the standard macros file
158 # `standard.mac' by another Perl script. Again, it's part of the
159 # standard distribution.
161 macros.c: standard.mac macros.pl
162 perl $(srcdir)/macros.pl $(srcdir)/standard.mac
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