fa0719e4195192781bfffdf28e8aee878e9228cb
[platform/upstream/nasm.git] / Mkfiles / Makefile.ms7
1 # Makefile for the Netwide Assembler under 16-bit DOS
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 using a 16-bit DOS C
9 # compiler such as Microsoft C, provided you have a compatible MAKE.
10 # It's been tested with Microsoft C 5.x plus Borland Make. (Yes, I
11 # know it's silly, but...)
12
13 # update:  MSC 5.1 will not compile 'nasmlib.c'   (arg lists don't match)
14 #          MSC 6.00A will not compile 'insnsa.c'  (qcl is required)
15 #          MSC 7.00 will compile all
16 #
17 # GNU software compiled by DJGPP is also required:
18 #
19 #    grep  2.4
20 #    perl  5.6.1
21 #
22 # Source and DOS/Windows binaries may be downloaded from:
23 #
24 #    ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/
25 #
26 # Compilation has been tested under Windows 98 & Windows 2000
27 # MSC 7.00 & DJGPP applications require a DPMI interface, which is
28 # a part of MSC 7.00 under DOS.  It is also a part of Windows.
29 #
30 #
31 # For a 16-bit compiler, we don't need all the formats
32 #
33 CONFIG = -DOF_ONLY -DOF_BIN -DOF_OBJ -DOF_WIN32 -DOF_AS86
34
35 #CC = cl /c /O /AL /Gt
36 #   Compile for a 286, ain't nobody using an 8086 anymore
37 CC = cl /c /Oz /AL /Gt256 /G2 /I.. # MSC 7.00
38
39 #QCL = qcl /c /AL /Gt
40 QCL = $(CC)                     # MSC 7.00
41
42 LINK = link
43 LINKFLAGS = /F4000 /Fm
44 LIBRARIES =
45 EXE = .exe#
46 OBJ = obj#
47
48 .c.$(OBJ):
49         $(CC) $(CONFIG) /Fo$@ $*.c
50
51 NASMOBJS1 = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
52            assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ)
53 NASMOBJS2 = output\outbin.$(OBJ) output\outaout.$(OBJ) output\outcoff.$(OBJ)
54 NASMOBJS3 = output\outelf32.$(OBJ) output\outelf64.$(OBJ) output\outobj.$(OBJ) output\outas86.$(OBJ)
55 NASMOBJS4 = output\outrdf.$(OBJ) output\outrdf2.$(OBJ) output\outieee.$(OBJ)
56 NASMOBJS5 = output\outdbg.$(OBJ) preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)
57
58 NASMOBJS = $(NASMOBJS1) $(NASMOBJS2) $(NASMOBJS3) $(NASMOBJS4) $(NASMOBJS5)
59
60 NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
61               insnsd.$(OBJ)
62
63 all : nasm$(EXE) ndisasm$(EXE)
64
65 # We have to have a horrible kludge here to get round the 128 character
66 # limit, as usual...
67 LINKOBJS = a*.obj e*.obj f*.obj insnsa.obj l*.obj na*.obj o*.obj p*.obj
68 nasm$(EXE): $(NASMOBJS)
69         echo $(NASMOBJS1) + >foo
70         echo $(NASMOBJS2) + >>foo
71         echo $(NASMOBJS3) + >>foo
72         echo $(NASMOBJS4) + >>foo
73         echo $(NASMOBJS5)   >> foo
74         $(LINK) /st:4096 @foo,nasm;
75
76 ndisasm$(EXE): $(NDISASMOBJS)
77         $(LINK) $(NDISASMOBJS), ndisasm;
78
79 output\version.h: version.h
80         copy version.h output
81
82 output\nasm.h: nasm.h
83         copy nasm.h output
84
85 output\insnsi.h: insnsi.h
86         copy insnsi.h output
87
88 output\nasmlib.h: nasmlib.h
89         copy nasmlib.h output
90
91 output\outform.h: outform.h
92         copy outform.h output
93
94 # These files contains all the standard macros that are derived from
95 # the version number.
96 version.h: version version.pl
97         perl version.pl h < version > version.h
98
99 version.mac: version version.pl
100         perl version.pl mac < version > version.mac
101
102 # This source file is generated from the standard macros file
103 # `standard.mac' by another Perl script. Again, it's part of the
104 # standard distribution.
105
106 macros.c: macros.pl standard.mac version.mac
107         perl macros.pl standard.mac version.mac
108
109 insnsa.c insnsd.c insnsi.h insnsn.c: insns16.dat insns.pl
110         perl insns.pl insns16.dat
111
112 insns16.dat:  insns.dat
113         grep -v WILLAMETTE insns.dat | grep -v KATMAI | grep -v SSE | \
114             grep -v MMX | grep -v 3DNOW | grep -v UNDOC >insns16.dat
115
116 # These source files are generated from regs.dat by yet another
117 # perl script.
118  regs.c: regs.dat regs.pl
119         perl regs.pl c regs.dat > regs.c
120 regflags.c: regs.dat regs.pl
121         perl regs.pl fc regs.dat > regflags.c
122 regdis.c: regs.dat regs.pl
123         perl regs.pl dc regs.dat > regdis.c
124 regvals.c: regs.dat regs.pl
125         perl regs.pl vc regs.dat > regvals.c
126 regs.h: regs.dat regs.pl
127         perl regs.pl h regs.dat > regs.h
128
129 # Another grotty hack: QC is less likely to run out of memory than
130 # CL proper; and we don't need any optimisation in these modules
131 # since they're just data.
132 insnsa.$(OBJ): insnsa.c nasm.h version.h insnsi.h insns.h
133         $(QCL) insnsa.c
134
135 insnsd.$(OBJ): insnsd.c nasm.h version.h insnsi.h insns.h
136         $(QCL) insnsd.c
137
138 tidy:
139         del output\*.h
140         del *.$(OBJ)
141         del output\*.$(OBJ)
142
143 clean :  tidy
144         del nasm$(EXE)
145         del ndisasm$(EXE)
146
147 spotless:  clean
148         del insns16.dat
149         del insnsa.c
150         del insnsd.c
151         del insnsi.h
152         del insnsn.c
153         del version.h
154
155 #-- Magic hints to mkdep.pl --#
156 # @object-ending: ".$(OBJ)"
157 # @path-separator: "\"
158 #-- Everything below is generated by mkdep.pl - do not edit --#
159 assemble.$(OBJ): assemble.c preproc.h insns.h pptok.h regs.h regflags.c \
160  config.h version.h nasmlib.h nasm.h regvals.c insnsi.h assemble.h
161 disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
162  version.h nasm.h insnsn.c names.c insnsi.h disasm.h
163 eval.$(OBJ): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h \
164  nasm.h
165 float.$(OBJ): float.c regs.h config.h version.h nasm.h
166 insnsa.$(OBJ): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
167 insnsd.$(OBJ): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
168 insnsn.$(OBJ): insnsn.c
169 labels.$(OBJ): labels.c regs.h config.h version.h nasmlib.h nasm.h
170 listing.$(OBJ): listing.c regs.h config.h version.h nasmlib.h nasm.h \
171  listing.h
172 macros.$(OBJ): macros.c
173 names.$(OBJ): names.c regs.c insnsn.c
174 nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h pptok.h \
175  regs.h outform.h config.h version.h nasmlib.h nasm.h stdscan.h assemble.h \
176  insnsi.h listing.h
177 nasmlib.$(OBJ): nasmlib.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
178  insnsi.h
179 ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
180  nasm.h insnsi.h disasm.h
181 outform.$(OBJ): outform.c regs.h config.h outform.h version.h nasm.h
182 output\outaout.$(OBJ): output\outaout.c regs.h outform.h config.h version.h \
183  nasmlib.h nasm.h stdscan.h
184 output\outas86.$(OBJ): output\outas86.c regs.h outform.h config.h version.h \
185  nasmlib.h nasm.h
186 output\outbin.$(OBJ): output\outbin.c labels.h eval.h regs.h outform.h \
187  config.h version.h nasmlib.h nasm.h stdscan.h
188 output\outcoff.$(OBJ): output\outcoff.c regs.h outform.h config.h version.h \
189  nasmlib.h nasm.h
190 output\outdbg.$(OBJ): output\outdbg.c regs.h outform.h config.h version.h \
191  nasmlib.h nasm.h
192 output\outelf32.$(OBJ): output\outelf32.c regs.h outform.h config.h \
193  version.h nasmlib.h nasm.h stdscan.h
194 output\outelf64.$(OBJ): output\outelf64.c regs.h outform.h config.h \
195  version.h nasmlib.h nasm.h stdscan.h
196 output\outieee.$(OBJ): output\outieee.c regs.h outform.h config.h version.h \
197  nasmlib.h nasm.h
198 output\outmacho.$(OBJ): output\outmacho.c compiler.h regs.h outform.h \
199  config.h version.h nasmlib.h nasm.h
200 output\outobj.$(OBJ): output\outobj.c regs.h outform.h config.h version.h \
201  nasmlib.h nasm.h stdscan.h
202 output\outrdf.$(OBJ): output\outrdf.c regs.h outform.h config.h version.h \
203  nasmlib.h nasm.h
204 output\outrdf2.$(OBJ): output\outrdf2.c rdoff\rdoff.h regs.h outform.h \
205  config.h version.h nasmlib.h nasm.h
206 parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
207  version.h nasmlib.h nasm.h stdscan.h insnsi.h
208 pptok.$(OBJ): pptok.c
209 preproc.$(OBJ): preproc.c preproc.h macros.c pptok.h regs.h config.h \
210  version.h nasmlib.h nasm.h
211 regdis.$(OBJ): regdis.c
212 regflags.$(OBJ): regflags.c
213 regs.$(OBJ): regs.c
214 regvals.$(OBJ): regvals.c
215 stdscan.$(OBJ): stdscan.c insns.h regs.h config.h version.h nasmlib.h nasm.h \
216  stdscan.h insnsi.h
217 sync.$(OBJ): sync.c sync.h
218 tokhash.$(OBJ): tokhash.c insns.h regs.h config.h version.h nasm.h insnsi.h