e45a398973633bcbd8845cd655ee149db10e2345
[platform/upstream/nasm.git] / Mkfiles / Makefile.vc
1 # Makefile for the Netwide Assembler under Win32
2 #
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.
7 #
8 # This Makefile is designed to build NASM as a Win32 command-
9 # line executable. It's been tested with Visual C++ 1.10.
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
19
20 .c.$(OBJ):
21         $(CC) $*.c
22
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)
30
31 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
32               insnsd.$(OBJ)
33
34 all : nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)
35
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)
41
42 ndisasm$(SUFFIX)$(EXE): $(NDISASMOBJS)
43         cl /Fendisasm$(SUFFIX).exe $(NDISASMOBJS)
44
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
52
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.
57
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
66
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
71
72 version.mac: version version.pl
73         perl version.pl mac < version > version.mac
74
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.
78
79 macros.c: macros.pl standard.mac version.mac
80         perl macros.pl standard.mac version.mac
81
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
94
95 clean :
96         del *.obj
97         del nasm$(SUFFIX)$(EXE)
98         del ndisasm$(SUFFIX)$(EXE)
99
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 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 \
109  nasm.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 \
116  listing.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 pptok.h \
120  regs.h outform.h config.h version.h nasmlib.h nasm.h stdscan.h assemble.h \
121  insnsi.h listing.h
122 nasmlib.$(OBJ): nasmlib.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
123  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 \
130  nasmlib.h nasm.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 \
134  nasmlib.h nasm.h
135 output/outdbg.$(OBJ): output/outdbg.c regs.h outform.h config.h version.h \
136  nasmlib.h nasm.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 \
142  nasmlib.h nasm.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 \
148  nasmlib.h nasm.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 pptok.$(OBJ): pptok.c
154 preproc.$(OBJ): preproc.c preproc.h macros.c pptok.h regs.h config.h \
155  version.h nasmlib.h nasm.h
156 regdis.$(OBJ): regdis.c
157 regflags.$(OBJ): regflags.c
158 regs.$(OBJ): regs.c
159 regvals.$(OBJ): regvals.c
160 stdscan.$(OBJ): stdscan.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
161  stdscan.h insnsi.h
162 sync.$(OBJ): sync.c sync.h
163 tokhash.$(OBJ): tokhash.c insns.h regs.h config.h version.h nasm.h insnsi.h