Minor fixes needed to compile with MSVC++ 2005
[nasm.git] / Mkfiles / Makefile.vc
blob148d1bb61c4b11facf2304aeee9fbceda87efaae
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.
12 QCL = cl /c
13 LINK = cl
14 LINKFLAGS =
15 LIBRARIES =
16 EXE = .exe#
17 OBJ = obj#
18 SUFFIX = w#  # by default, this makefile produces nasmw.exe and ndisasmw.exe
20 .c.$(OBJ):
21         $(CC) $*.c
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) \
29            output/outieee.$(OBJ)
31 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
32               insnsd.$(OBJ)
34 all : nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
36 # We have to have a horrible kludge here to get round the 128 character
37 # limit, as usual...
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
49         $(QCL) insnsa.c
50 insnsd.$(OBJ): insnsd.c nasm.h version.h insnsi.h insns.h
51         $(QCL) insnsd.c
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
68 # the version number.
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
83 # perl script.
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
95 clean :
96         del *.obj
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 pptok.h regs.h regflags.c \
105  config.h version.h nasmlib.h nasm.h regvals.c assemble.h insnsi.h
106 crc64.$(OBJ): crc64.c
107 disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
108  version.h nasm.h insnsn.c names.c insnsi.h disasm.h
109 eval.$(OBJ): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h \
110  nasm.h insnsi.h
111 float.$(OBJ): float.c regs.h config.h version.h nasm.h insnsi.h
112 hashtbl.$(OBJ): hashtbl.c regs.h config.h version.h nasmlib.h hashtbl.h \
113  nasm.h insnsi.h
114 insnsa.$(OBJ): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
115 insnsd.$(OBJ): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
116 insnsn.$(OBJ): insnsn.c
117 labels.$(OBJ): labels.c regs.h config.h version.h hashtbl.h nasmlib.h nasm.h \
118  insnsi.h
119 listing.$(OBJ): listing.c regs.h config.h version.h nasmlib.h nasm.h \
120  insnsi.h listing.h
121 macros.$(OBJ): macros.c
122 names.$(OBJ): names.c regs.c insnsn.c
123 nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h pptok.h \
124  regs.h outform.h config.h version.h nasmlib.h nasm.h stdscan.h assemble.h \
125  insnsi.h listing.h
126 nasmlib.$(OBJ): nasmlib.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
127  insnsi.h
128 ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
129  nasm.h insnsi.h disasm.h
130 outform.$(OBJ): outform.c regs.h config.h outform.h version.h nasm.h \
131  insnsi.h
132 output/outaout.$(OBJ): output/outaout.c regs.h outform.h config.h version.h \
133  nasmlib.h nasm.h stdscan.h insnsi.h
134 output/outas86.$(OBJ): output/outas86.c regs.h outform.h config.h version.h \
135  nasmlib.h nasm.h insnsi.h
136 output/outbin.$(OBJ): output/outbin.c labels.h eval.h regs.h outform.h \
137  config.h version.h nasmlib.h nasm.h stdscan.h insnsi.h
138 output/outcoff.$(OBJ): output/outcoff.c regs.h outform.h config.h version.h \
139  nasmlib.h nasm.h insnsi.h
140 output/outdbg.$(OBJ): output/outdbg.c regs.h outform.h config.h version.h \
141  nasmlib.h nasm.h insnsi.h
142 output/outelf32.$(OBJ): output/outelf32.c regs.h outform.h config.h \
143  version.h nasmlib.h nasm.h stdscan.h insnsi.h
144 output/outelf64.$(OBJ): output/outelf64.c regs.h outform.h config.h \
145  version.h nasmlib.h nasm.h stdscan.h insnsi.h
146 output/outieee.$(OBJ): output/outieee.c regs.h outform.h config.h version.h \
147  nasmlib.h nasm.h insnsi.h
148 output/outmacho.$(OBJ): output/outmacho.c compiler.h regs.h outform.h \
149  config.h version.h nasmlib.h nasm.h insnsi.h
150 output/outobj.$(OBJ): output/outobj.c regs.h outform.h config.h version.h \
151  nasmlib.h nasm.h stdscan.h insnsi.h
152 output/outrdf.$(OBJ): output/outrdf.c regs.h outform.h config.h version.h \
153  nasmlib.h nasm.h insnsi.h
154 output/outrdf2.$(OBJ): output/outrdf2.c rdoff/rdoff.h regs.h outform.h \
155  config.h version.h nasmlib.h nasm.h insnsi.h
156 parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
157  version.h nasmlib.h nasm.h stdscan.h insnsi.h
158 pptok.$(OBJ): pptok.c preproc.h pptok.h nasmlib.h
159 preproc.$(OBJ): preproc.c preproc.h macros.c pptok.h regs.h config.h \
160  version.h hashtbl.h nasmlib.h nasm.h insnsi.h
161 regdis.$(OBJ): regdis.c
162 regflags.$(OBJ): regflags.c
163 regs.$(OBJ): regs.c
164 regvals.$(OBJ): regvals.c
165 stdscan.$(OBJ): stdscan.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
166  stdscan.h insnsi.h
167 sync.$(OBJ): sync.c sync.h
168 tokhash.$(OBJ): tokhash.c insns.h regs.h config.h version.h nasm.h insnsi.h