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) output/outelf.$(OBJ) \
26 output/outobj.$(OBJ) output/outas86.$(OBJ) output/outrdf.$(OBJ) output/outdbg.$(OBJ) \
27 preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) output/outrdf2.$(OBJ) \
30 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
33 all : nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
35 # We have to have a horrible kludge here to get round the 128 character
37 LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj z*.obj
38 nasm$(SUFFIX)$(EXE): $(NASMOBJS)
39 cl /Fenasm$(SUFFIX).exe $(LINKOBJS)
41 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
42 cl /Fendisasm$(SUFFIX).exe $(NDISASMOBJS)
44 # Another grotty hack: QC is less likely to run out of memory than
45 # CL proper; and we don't need any optimisation in these modules
46 # since they're just data.
47 insnsa.$(OBJ): insnsa.c nasm.h version.h insnsi.h insns.h
49 insnsd.$(OBJ): insnsd.c nasm.h version.h insnsi.h insns.h
52 # These source files are automagically generated from a single
53 # instruction-table file by a Perl script. They're distributed,
54 # though, so it isn't necessary to have Perl just to recompile NASM
55 # from the distribution.
57 insnsa.c: insns.dat insns.pl
58 perl insns.pl -a insns.dat
59 insnsd.c: insns.dat insns.pl
60 perl insns.pl -d insns.dat
61 insnsi.h: insns.dat insns.pl
62 perl insns.pl -i insns.dat
63 insnsn.c: insns.dat insns.pl
64 perl insns.pl -n insns.dat
66 # These files contains all the standard macros that are derived from
68 version.h: version version.pl
69 perl version.pl h < version > version.h
71 version.mac: version version.pl
72 perl version.pl mac < version > version.mac
74 # This source file is generated from the standard macros file
75 # `standard.mac' by another Perl script. Again, it's part of the
76 # standard distribution.
78 macros.c: macros.pl standard.mac version.mac
79 perl macros.pl standard.mac version.mac
81 # These source files are generated from regs.dat by yet another
83 regs.c: regs.dat regs.pl
84 perl regs.pl c regs.dat > regs.c
85 regflags.c: regs.dat regs.pl
86 perl regs.pl fc regs.dat > regflags.c
87 regdis.c: regs.dat regs.pl
88 perl regs.pl dc regs.dat > regdis.c
89 regvals.c: regs.dat regs.pl
90 perl regs.pl vc regs.dat > regvals.c
91 regs.h: regs.dat regs.pl
92 perl regs.pl h regs.dat > regs.h
96 del nasm$(SUFFIX)$(EXE)
97 del ndisasm$(SUFFIX)$(EXE)
99 #-- Magic hints to mkdep.pl --#
100 # @object-ending: ".$(OBJ)"
101 # @path-separator: "/"
102 #-- Everything below is generated by mkdep.pl - do not edit --#
103 assemble.$(OBJ): assemble.c insns.h assemble.h regvals.c nasm.h regs.h \
104 insnsi.h nasmlib.h version.h
105 disasm.$(OBJ): disasm.c insns.h regs.c sync.h names.c nasm.h disasm.h regs.h \
106 insnsn.c insnsi.h version.h regdis.c
107 eval.$(OBJ): eval.c nasm.h regs.h labels.h nasmlib.h version.h eval.h
108 float.$(OBJ): float.c nasm.h regs.h version.h
109 insnsa.$(OBJ): insnsa.c insns.h nasm.h regs.h insnsi.h version.h
110 insnsd.$(OBJ): insnsd.c insns.h nasm.h regs.h insnsi.h version.h
111 insnsn.$(OBJ): insnsn.c
112 labels.$(OBJ): labels.c nasm.h regs.h nasmlib.h version.h
113 listing.$(OBJ): listing.c listing.h nasm.h regs.h nasmlib.h version.h
114 macros.$(OBJ): macros.c
115 names.$(OBJ): names.c regs.c insnsn.c
116 nasm.$(OBJ): nasm.c listing.h preproc.h insns.h outform.h assemble.h \
117 parser.h nasm.h regs.h labels.h insnsi.h nasmlib.h version.h eval.h
118 nasmlib.$(OBJ): nasmlib.c insns.h regs.c names.c nasm.h regs.h insnsn.c \
119 insnsi.h nasmlib.h version.h
120 ndisasm.$(OBJ): ndisasm.c insns.h sync.h nasm.h disasm.h regs.h insnsi.h \
122 outform.$(OBJ): outform.c outform.h nasm.h regs.h version.h
123 output/outaout.$(OBJ): output/outaout.c outform.h nasm.h regs.h nasmlib.h \
125 output/outas86.$(OBJ): output/outas86.c outform.h nasm.h regs.h nasmlib.h \
127 output/outbin.$(OBJ): output/outbin.c outform.h nasm.h regs.h nasmlib.h \
129 output/outcoff.$(OBJ): output/outcoff.c outform.h nasm.h regs.h nasmlib.h \
131 output/outdbg.$(OBJ): output/outdbg.c outform.h nasm.h regs.h nasmlib.h \
133 output/outelf.$(OBJ): output/outelf.c outform.h nasm.h regs.h nasmlib.h \
135 output/outieee.$(OBJ): output/outieee.c outform.h nasm.h regs.h nasmlib.h \
137 output/outobj.$(OBJ): output/outobj.c outform.h nasm.h regs.h nasmlib.h \
139 output/outrdf.$(OBJ): output/outrdf.c outform.h nasm.h regs.h nasmlib.h \
141 output/outrdf2.$(OBJ): output/outrdf2.c outform.h nasm.h regs.h nasmlib.h \
143 parser.$(OBJ): parser.c insns.h parser.h nasm.h regs.h insnsi.h regflags.c \
144 float.h nasmlib.h version.h
145 preproc.$(OBJ): preproc.c nasm.h macros.c regs.h nasmlib.h version.h
146 regdis.$(OBJ): regdis.c
147 regflags.$(OBJ): regflags.c
149 regvals.$(OBJ): regvals.c
150 sync.$(OBJ): sync.c sync.h