1 # Makefile for the Netwide Assembler under Win32
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 as a Win32 command-
9 # line executable. It's been tested with Visual C++ 1.10.
11 CC = cl /c /Ox /GF /I.
18 SUFFIX = w# # by default, this makefile produces nasmw.exe and ndisasmw.exe
23 NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
24 assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
25 output/outbin.$(OBJ) output/outaout.$(OBJ) output/outcoff.$(OBJ) \
26 output/outelf32.$(OBJ) output/outelf64.$(OBJ) \
27 output/outobj.$(OBJ) output/outas86.$(OBJ) output/outrdf.$(OBJ) output/outdbg.$(OBJ) \
28 preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) output/outrdf2.$(OBJ) \
31 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
34 all : nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
36 # We have to have a horrible kludge here to get round the 128 character
38 LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj z*.obj
39 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
40 cl /Fenasm$(SUFFIX).exe $(LINKOBJS)
42 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
43 cl /Fendisasm$(SUFFIX).exe $(NDISASMOBJS)
45 # Another grotty hack: QC is less likely to run out of memory than
46 # CL proper; and we don't need any optimisation in these modules
47 # since they're just data.
48 insnsa.$(OBJ): insnsa.c nasm.h version.h insnsi.h insns.h
50 insnsd.$(OBJ): insnsd.c nasm.h version.h insnsi.h insns.h
53 # These source files are automagically generated from a single
54 # instruction-table file by a Perl script. They're distributed,
55 # though, so it isn't necessary to have Perl just to recompile NASM
56 # from the distribution.
58 insnsa.c: insns.dat insns.pl
59 perl insns.pl -a insns.dat
60 insnsd.c: insns.dat insns.pl
61 perl insns.pl -d insns.dat
62 insnsi.h: insns.dat insns.pl
63 perl insns.pl -i insns.dat
64 insnsn.c: insns.dat insns.pl
65 perl insns.pl -n insns.dat
67 # These files contains all the standard macros that are derived from
69 version.h: version version.pl
70 perl version.pl h < version > version.h
72 version.mac: version version.pl
73 perl version.pl mac < version > version.mac
75 # This source file is generated from the standard macros file
76 # `standard.mac' by another Perl script. Again, it's part of the
77 # standard distribution.
79 macros.c: macros.pl standard.mac version.mac
80 perl macros.pl standard.mac version.mac
82 # These source files are generated from regs.dat by yet another
84 regs.c: regs.dat regs.pl
85 perl regs.pl c regs.dat > regs.c
86 regflags.c: regs.dat regs.pl
87 perl regs.pl fc regs.dat > regflags.c
88 regdis.c: regs.dat regs.pl
89 perl regs.pl dc regs.dat > regdis.c
90 regvals.c: regs.dat regs.pl
91 perl regs.pl vc regs.dat > regvals.c
92 regs.h: regs.dat regs.pl
93 perl regs.pl h regs.dat > regs.h
97 del nasm$(SUFFIX)$(EXE)
98 del ndisasm$(SUFFIX)$(EXE)
100 #-- Magic hints to mkdep.pl --#
101 # @object-ending: ".$(OBJ)"
102 # @path-separator: "/"
103 #-- Everything below is generated by mkdep.pl - do not edit --#
104 assemble.$(OBJ): assemble.c preproc.h insns.h regs.h regflags.c config.h \
105 version.h nasmlib.h nasm.h regvals.c insnsi.h assemble.h
106 disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
107 version.h nasm.h insnsn.c names.c insnsi.h disasm.h
108 eval.$(OBJ): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h \
110 float.$(OBJ): float.c regs.h config.h version.h nasm.h
111 insnsa.$(OBJ): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
112 insnsd.$(OBJ): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
113 insnsn.$(OBJ): insnsn.c
114 labels.$(OBJ): labels.c regs.h config.h version.h nasmlib.h nasm.h
115 listing.$(OBJ): listing.c regs.h config.h version.h nasmlib.h nasm.h \
117 macros.$(OBJ): macros.c
118 names.$(OBJ): names.c regs.c insnsn.c
119 nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
120 outform.h config.h version.h nasmlib.h nasm.h stdscan.h assemble.h insnsi.h \
122 nasmlib.$(OBJ): nasmlib.c insns.h regs.h config.h regs.c version.h nasmlib.h \
123 nasm.h insnsn.c names.c insnsi.h
124 ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
125 nasm.h insnsi.h disasm.h
126 outform.$(OBJ): outform.c regs.h config.h outform.h version.h nasm.h
127 output/outaout.$(OBJ): output/outaout.c regs.h outform.h config.h version.h \
128 nasmlib.h nasm.h stdscan.h
129 output/outas86.$(OBJ): output/outas86.c regs.h outform.h config.h version.h \
131 output/outbin.$(OBJ): output/outbin.c labels.h eval.h regs.h outform.h \
132 config.h version.h nasmlib.h nasm.h stdscan.h
133 output/outcoff.$(OBJ): output/outcoff.c regs.h outform.h config.h version.h \
135 output/outdbg.$(OBJ): output/outdbg.c regs.h outform.h config.h version.h \
137 output/outelf32.$(OBJ): output/outelf32.c regs.h outform.h config.h \
138 version.h nasmlib.h nasm.h stdscan.h
139 output/outelf64.$(OBJ): output/outelf64.c regs.h outform.h config.h \
140 version.h nasmlib.h nasm.h stdscan.h
141 output/outieee.$(OBJ): output/outieee.c regs.h outform.h config.h version.h \
143 output/outmacho.$(OBJ): output/outmacho.c compiler.h regs.h outform.h \
144 config.h version.h nasmlib.h nasm.h
145 output/outobj.$(OBJ): output/outobj.c regs.h outform.h config.h version.h \
146 nasmlib.h nasm.h stdscan.h
147 output/outrdf.$(OBJ): output/outrdf.c regs.h outform.h config.h version.h \
149 output/outrdf2.$(OBJ): output/outrdf2.c rdoff/rdoff.h regs.h outform.h \
150 config.h version.h nasmlib.h nasm.h
151 parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
152 version.h nasmlib.h nasm.h stdscan.h insnsi.h
153 preproc.$(OBJ): preproc.c macros.c regs.h config.h version.h nasmlib.h \
155 regdis.$(OBJ): regdis.c
156 regflags.$(OBJ): regflags.c
158 regvals.$(OBJ): regvals.c
159 stdscan.$(OBJ): stdscan.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
161 sync.$(OBJ): sync.c sync.h
162 tokhash.$(OBJ): tokhash.c insns.h regs.h config.h version.h nasm.h insnsi.h