Move all the RAA code out of nasmlib
[nasm/autotest.git] / Mkfiles / owlinux.mak
blobbb10d9e74ba3adeb79354e711f35b2909f0a51c8
1 # -*- makefile -*-
3 # Makefile for cross-compiling NASM from Linux
4 # to DOS, Win32 or OS/2 using OpenWatcom.
6 # Please see http://bugzilla.openwatcom.org/show_bug.cgi?id=751
7 # for some caveats in using OpenWatcom as a cross-compiler
8 # from Linux, in particular:
10 # > Second and more importantly, the makefile needs to ensure that the
11 # > proper headers are included. This is normally not a problem when
12 # > building on DOS, Windows, or OS/2, as they share the same C
13 # > library headers. But when cross-compiling from (or to) Linux, it
14 # > is crucial.
15 # >
16 # > This may be accomplished by setting the INCLUDE env var in the
17 # > makefile, or setting OS2_INCLUDE, DOS_INCLUDE, NT_INCLUDE env vars
18 # > *and* making sure that the proper -bt switch is used, or passing a
19 # > switch like -I"$(%WATCOM)/h". The last variant is probably the
20 # > easiest to implement and least likely to break.
23 top_srcdir = .
24 srcdir = .
25 prefix = C:/Program Files/NASM
26 exec_prefix = $(prefix)
27 bindir = $(prefix)/bin
28 mandir = $(prefix)/man
30 CC = wcl386
31 DEBUG =
32 CFLAGS = -6 -ox -wx -ze -fpi $(DEBUG)
33 BUILD_CFLAGS = $(CFLAGS) $(TARGET_FLAGS) # -I$(srcdir)/inttypes
34 INTERNAL_CFLAGS = -I$(srcdir) -I. \
35 -DHAVE_SNPRINTF -DHAVE_VSNPRINTF
36 ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
37 LD = $(CC)
38 LDFLAGS = $(ALL_CFLAGS)
39 LIBS =
40 PERL = perl -I$(srcdir)/perllib
42 STRIP = wstrip
44 # Binary suffixes
45 O = obj
46 X = .exe
48 # WMAKE errors out if a suffix is declared more than once, including
49 # its own built-in declarations. Thus, we need to explicitly clear the list
50 # first. Also, WMAKE only allows implicit rules that point "to the left"
51 # in this list!
52 .SUFFIXES:
53 .SUFFIXES: .man .1 .$(O) .i .c
55 .c.$(O):
56 $(CC) -c $(ALL_CFLAGS) -fo=$@ $<
58 NASM = nasm.$(O) nasmlib.$(O) raa.$(O) saa.$(O) \
59 float.$(O) insnsa.$(O) insnsb.$(O) \
60 assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
61 outform.$(O) output/outbin.$(O) \
62 output/outaout.$(O) output/outcoff.$(O) \
63 output/outelf32.$(O) output/outelf64.$(O) \
64 output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
65 output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
66 preproc.$(O) quote.$(O) pptok.$(O) macros.$(O) \
67 listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O) \
68 regvals.$(O) regflags.$(O)
70 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) \
71 insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O)
73 what:
74 @echo 'Please build "dos", "win32" or "os2"'
76 dos:
77 $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=DOS -l=DOS4G'
79 win32:
80 $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=NT -l=NT'
82 os2:
83 $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=OS2 -l=OS2V2'
85 all: nasm$(X) ndisasm$(X)
87 nasm$(X): $(NASM)
88 $(LD) $(LDFLAGS) -fe=nasm$(X) $(NASM) $(LIBS)
90 ndisasm$(X): $(NDISASM)
91 $(LD) $(LDFLAGS) -fe=ndisasm$(X) $(NDISASM) $(LIBS)
93 # These source files are automagically generated from a single
94 # instruction-table file by a Perl script. They're distributed,
95 # though, so it isn't necessary to have Perl just to recompile NASM
96 # from the distribution.
98 insnsb.c: insns.dat insns.pl
99 $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat
100 insnsa.c: insns.dat insns.pl
101 $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
102 insnsd.c: insns.dat insns.pl
103 $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
104 insnsi.h: insns.dat insns.pl
105 $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
106 insnsn.c: insns.dat insns.pl
107 $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
109 # These files contains all the standard macros that are derived from
110 # the version number.
111 version.h: version version.pl
112 $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
114 version.mac: version version.pl
115 $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
117 # This source file is generated from the standard macros file
118 # `standard.mac' by another Perl script. Again, it's part of the
119 # standard distribution.
121 macros.c: macros.pl standard.mac version.mac
122 $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
124 # These source files are generated from regs.dat by yet another
125 # perl script.
126 regs.c: regs.dat regs.pl
127 $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
128 regflags.c: regs.dat regs.pl
129 $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
130 regdis.c: regs.dat regs.pl
131 $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
132 regdis.h: regs.dat regs.pl
133 $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h
134 regvals.c: regs.dat regs.pl
135 $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
136 regs.h: regs.dat regs.pl
137 $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
139 # Assembler token hash
140 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
141 $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
142 $(srcdir)/tokens.dat > tokhash.c
144 # Assembler token metadata
145 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
146 $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
147 $(srcdir)/tokens.dat > tokens.h
149 # Preprocessor token hash
150 pptok.h: pptok.dat pptok.pl perllib/phash.ph
151 $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
152 pptok.c: pptok.dat pptok.pl perllib/phash.ph
153 $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
155 # This target generates all files that require perl.
156 # This allows easier generation of distribution (see dist target).
157 PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \
158 regs.c regs.h regflags.c regdis.c regdis.h regvals.c \
159 tokhash.c tokens.h pptok.h pptok.c \
160 version.h version.mac
161 perlreq: $(PERLREQ)
163 clean:
164 -rm -f *.$(O)
165 -rm -f *.s
166 -rm -f *.i
167 -rm -f output/*.$(O)
168 -rm -f output/*.s
169 -rm -f output/*.i
170 -rm -f nasm$(X)
171 -rm -f ndisasm$(X)
172 # cd rdoff && $(MAKE) clean
174 distclean: clean .SYMBOLIC
175 -rm -f config.h
176 -rm -f config.log
177 -rm -f config.status
178 -rm -f Makefile
179 -rm -f *~
180 -rm -f *.bak
181 -rm -f *.lst
182 -rm -f *.bin
183 -rm -f output/*~
184 -rm -f output/*.bak
185 -rm -f test/*.lst
186 -rm -f test/*.bin
187 -rm -f test/*.$(O)
188 -rm -f test/*.bin
189 -rm -f/s autom4te*.cache
190 # cd rdoff && $(MAKE) distclean
192 cleaner: clean .SYMBOLIC
193 -rm -f $(PERLREQ)
194 -rm -f *.man
195 -rm -f nasm.spec
196 # cd doc && $(MAKE) clean
198 spotless: distclean cleaner .SYMBOLIC
199 -rm -f doc/Makefile
200 -rm -f doc/*~
201 -rm -f doc/*.bak
203 strip:
204 $(STRIP) *.exe
206 rdf:
207 # cd rdoff && $(MAKE)
209 doc:
210 # cd doc && $(MAKE) all
212 everything: all doc rdf
214 #-- Magic hints to mkdep.pl --#
215 # @object-ending: ".$(O)"
216 # @path-separator: "/"
217 # @exclude: "config.h"
218 # @continuation: "\"
219 #-- Everything below is generated by mkdep.pl - do not edit --#
220 assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
221 nasmlib.h regs.h tables.h tokens.h version.h
222 crc64.$(O): crc64.c compiler.h
223 disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h \
224 regdis.h regs.h sync.h tables.h tokens.h version.h
225 eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
226 nasmlib.h regs.h version.h
227 exprlib.$(O): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
228 version.h
229 float.$(O): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h regs.h \
230 version.h
231 hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
232 regs.h version.h
233 insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
234 tokens.h version.h
235 insnsb.$(O): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
236 tokens.h version.h
237 insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
238 tokens.h version.h
239 insnsn.$(O): insnsn.c compiler.h insnsi.h tables.h
240 labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
241 version.h
242 lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h
243 lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h
244 listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
245 regs.h version.h
246 macros.$(O): macros.c compiler.h insnsi.h tables.h
247 nasm.$(O): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h \
248 labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h \
249 raa.h regs.h saa.h stdscan.h tokens.h version.h
250 nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
251 tokens.h version.h
252 ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
253 nasmlib.h regs.h sync.h tokens.h version.h
254 outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
255 regs.h version.h
256 output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
257 outform.h raa.h regs.h saa.h stdscan.h version.h
258 output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
259 outform.h raa.h regs.h saa.h version.h
260 output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
261 nasm.h nasmlib.h outform.h regs.h saa.h stdscan.h version.h
262 output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
263 outform.h raa.h regs.h saa.h version.h
264 output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
265 outform.h regs.h version.h
266 output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
267 outform.h raa.h regs.h saa.h stdscan.h version.h
268 output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
269 outform.h raa.h regs.h saa.h stdscan.h version.h
270 output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
271 outform.h regs.h version.h
272 output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
273 outform.h raa.h regs.h saa.h version.h
274 output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
275 outform.h regs.h stdscan.h version.h
276 output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
277 outform.h regs.h version.h
278 output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
279 outform.h rdoff/rdoff.h regs.h saa.h version.h
280 parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
281 parser.h regs.h stdscan.h tables.h tokens.h version.h
282 pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
283 preproc.$(O): preproc.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
284 pptok.h preproc.h quote.h regs.h stdscan.h tables.h tokens.h version.h
285 quote.$(O): quote.c compiler.h nasmlib.h quote.h
286 raa.$(O): raa.c compiler.h nasmlib.h raa.h
287 regdis.$(O): regdis.c regdis.h regs.h
288 regflags.$(O): regflags.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
289 tables.h version.h
290 regs.$(O): regs.c compiler.h insnsi.h tables.h
291 regvals.$(O): regvals.c compiler.h insnsi.h tables.h
292 saa.$(O): saa.c compiler.h nasmlib.h saa.h
293 stdscan.$(O): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h quote.h \
294 regs.h stdscan.h tokens.h version.h
295 sync.$(O): sync.c compiler.h nasmlib.h sync.h
296 tokhash.$(O): tokhash.c compiler.h hashtbl.h insns.h insnsi.h nasm.h \
297 nasmlib.h regs.h tokens.h version.h