Exclude config.h from the dependency list for the canned makefiles
[platform/upstream/nasm.git] / Mkfiles / owlinux.mak
1 # -*- makefile -*-
2 #
3 # Makefile for cross-compiling NASM from Linux
4 # to DOS, Win32 or OS/2 using OpenWatcom.
5 #
6
7 top_srcdir      = .
8 srcdir          = .
9 prefix          = C:/Program Files/NASM
10 exec_prefix     = $(prefix)
11 bindir          = $(prefix)/bin
12 mandir          = $(prefix)/man
13
14 CC              = wcl386
15 CFLAGS          = -3 -bcl=$(TARGET) -ox -wx -ze -fpi
16 BUILD_CFLAGS    = $(CFLAGS) # -I$(srcdir)/inttypes
17 INTERNAL_CFLAGS = -I$(srcdir) -I.
18 ALL_CFLAGS      = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
19 LD              = $(CC)
20 LDFLAGS         = $(ALL_CFLAGS)
21 LIBS            = 
22 PERL            = perl -I$(srcdir)/perllib
23
24 STRIP           = wstrip
25
26 # Binary suffixes
27 O               = obj
28 X               = .exe
29
30 # WMAKE errors out if a suffix is declared more than once, including
31 # its own built-in declarations.  Thus, we need to explicitly clear the list
32 # first.  Also, WMAKE only allows implicit rules that point "to the left"
33 # in this list!
34 .SUFFIXES:
35 .SUFFIXES: .man .1 .$(O) .i .c
36
37 .c.$(O):
38         $(CC) -c $(ALL_CFLAGS) -fo=$@ $<
39
40 NASM =  nasm.$(O) nasmlib.$(O) float.$(O) insnsa.$(O) assemble.$(O) \
41         labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \
42         outform.$(O) output/outbin.$(O) \
43         output/outaout.$(O) output/outcoff.$(O) \
44         output/outelf32.$(O) output/outelf64.$(O) \
45         output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
46         output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
47         preproc.$(O) pptok.$(O) \
48         listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) tokhash.$(O)
49
50 NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) insnsd.$(O)
51
52 what:
53         @echo 'Please build "dos", "win32" or "os2"'
54
55 dos:
56         $(MAKE) -f $(MAKEFILE_LIST) all TARGET=DOS4G
57
58 win32:
59         $(MAKE) -f $(MAKEFILE_LIST) all TARGET=NT
60
61 os2:
62         $(MAKE) -f $(MAKEFILE_LIST) all TARGET=OS2V2
63
64 all: nasm$(X) ndisasm$(X)
65
66 nasm$(X): $(NASM)
67         $(LD) $(LDFLAGS) -fe=nasm$(X) $(NASM) $(LIBS)
68
69 ndisasm$(X): $(NDISASM)
70         $(LD) $(LDFLAGS) -fe=ndisasm$(X) $(NDISASM) $(LIBS)
71
72 # These source files are automagically generated from a single
73 # instruction-table file by a Perl script. They're distributed,
74 # though, so it isn't necessary to have Perl just to recompile NASM
75 # from the distribution.
76
77 insnsa.c: insns.dat insns.pl
78         $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat
79 insnsd.c: insns.dat insns.pl
80         $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat
81 insnsi.h: insns.dat insns.pl
82         $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat
83 insnsn.c: insns.dat insns.pl
84         $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat
85
86 # These files contains all the standard macros that are derived from
87 # the version number.
88 version.h: version version.pl
89         $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
90
91 version.mac: version version.pl
92         $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
93
94 # This source file is generated from the standard macros file
95 # `standard.mac' by another Perl script. Again, it's part of the
96 # standard distribution.
97
98 macros.c: macros.pl standard.mac version.mac
99         $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac
100
101 # These source files are generated from regs.dat by yet another
102 # perl script.
103 regs.c: regs.dat regs.pl
104         $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c
105 regflags.c: regs.dat regs.pl
106         $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c
107 regdis.c: regs.dat regs.pl
108         $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c
109 regvals.c: regs.dat regs.pl
110         $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c
111 regs.h: regs.dat regs.pl
112         $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h
113
114 # Assembler token hash
115 tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
116         $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \
117                 $(srcdir)/tokens.dat > tokhash.c
118
119 # Assembler token metadata
120 tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph
121         $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \
122                 $(srcdir)/tokens.dat > tokens.h
123
124 # Preprocessor token hash
125 pptok.h: pptok.dat pptok.pl perllib/phash.ph
126         $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h
127 pptok.c: pptok.dat pptok.pl perllib/phash.ph
128         $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c
129
130 # This target generates all files that require perl.
131 # This allows easier generation of distribution (see dist target).
132 PERLREQ = macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
133           regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \
134           version.h version.mac pptok.h pptok.c
135 perlreq: $(PERLREQ)
136
137 clean:
138         -rm -f *.$(O)
139         -rm -f *.s
140         -rm -f *.i
141         -rm -f output/*.$(O)
142         -rm -f output/*.s
143         -rm -f output/*.i
144         -rm -f nasm$(X)
145         -rm -f ndisasm$(X)
146         cd rdoff && $(MAKE) clean
147
148 distclean: clean .SYMBOLIC
149         -rm -f config.h
150         -rm -f config.log
151         -rm -f config.status
152         -rm -f Makefile
153         -rm -f *~
154         -rm -f *.bak
155         -rm -f *.lst
156         -rm -f *.bin
157         -rm -f output/*~
158         -rm -f output/*.bak
159         -rm -f test/*.lst
160         -rm -f test/*.bin
161         -rm -f test/*.$(O)
162         -rm -f test/*.bin
163         -rm -f/s autom4te*.cache
164         cd rdoff && $(MAKE) distclean
165
166 cleaner: clean .SYMBOLIC
167         -rm -f $(PERLREQ)
168         -rm -f *.man
169         -rm -f nasm.spec
170         cd doc && $(MAKE) clean
171
172 spotless: distclean cleaner .SYMBOLIC
173         -rm -f doc/Makefile
174         -rm -f doc/*~
175         -rm -f doc/*.bak
176
177 strip:
178         $(STRIP) *.exe
179
180 rdf:
181         # cd rdoff && $(MAKE)
182
183 doc:
184         # cd doc && $(MAKE) all
185
186 everything: all doc rdf
187
188 #-- Magic hints to mkdep.pl --#
189 # @object-ending: ".$(O)"
190 # @path-separator: "/"
191 # @exclude: "config.h"
192 # @continuation: "\"
193 #-- Everything below is generated by mkdep.pl - do not edit --#
194 assemble.$(O): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h \
195  nasmlib.h pptok.h preproc.h regflags.c regs.h regvals.c tokens.h version.h
196 crc64.$(O): crc64.c
197 disasm.$(O): disasm.c compiler.h disasm.h insns.h insnsi.h insnsn.c names.c \
198  nasm.h nasmlib.h regdis.c regs.c regs.h sync.h tokens.h version.h
199 eval.$(O): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h \
200  nasmlib.h regs.h version.h
201 exprlib.$(O): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h regs.h \
202  version.h
203 float.$(O): float.c compiler.h insnsi.h nasm.h nasmlib.h regs.h version.h
204 hashtbl.$(O): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h \
205  regs.h version.h
206 insnsa.$(O): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
207  tokens.h version.h
208 insnsd.$(O): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
209  tokens.h version.h
210 insnsn.$(O): insnsn.c
211 labels.$(O): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h regs.h \
212  version.h
213 listing.$(O): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h \
214  regs.h version.h
215 macros.$(O): macros.c
216 names.$(O): names.c insnsn.c regs.c
217 nasm.$(O): nasm.c assemble.h compiler.h eval.h insns.h insnsi.h labels.h \
218  listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h regs.h \
219  stdscan.h tokens.h version.h
220 nasmlib.$(O): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
221  tokens.h version.h
222 ndisasm.$(O): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h \
223  nasmlib.h regs.h sync.h tokens.h version.h
224 outform.$(O): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h \
225  regs.h version.h
226 output/outaout.$(O): output/outaout.c compiler.h insnsi.h nasm.h nasmlib.h \
227  outform.h regs.h stdscan.h version.h
228 output/outas86.$(O): output/outas86.c compiler.h insnsi.h nasm.h nasmlib.h \
229  outform.h regs.h version.h
230 output/outbin.$(O): output/outbin.c compiler.h eval.h insnsi.h labels.h \
231  nasm.h nasmlib.h outform.h regs.h stdscan.h version.h
232 output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \
233  outform.h regs.h version.h
234 output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \
235  outform.h regs.h version.h
236 output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \
237  outform.h regs.h stdscan.h version.h
238 output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \
239  outform.h regs.h stdscan.h version.h
240 output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \
241  outform.h regs.h version.h
242 output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \
243  outform.h regs.h version.h
244 output/outobj.$(O): output/outobj.c compiler.h insnsi.h nasm.h nasmlib.h \
245  outform.h regs.h stdscan.h version.h
246 output/outrdf.$(O): output/outrdf.c compiler.h insnsi.h nasm.h nasmlib.h \
247  outform.h regs.h version.h
248 output/outrdf2.$(O): output/outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h \
249  outform.h rdoff/rdoff.h regs.h version.h
250 parser.$(O): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h \
251  parser.h regflags.c regs.h stdscan.h tokens.h version.h
252 pptok.$(O): pptok.c compiler.h nasmlib.h pptok.h preproc.h
253 preproc.$(O): preproc.c compiler.h hashtbl.h insnsi.h macros.c nasm.h \
254  nasmlib.h pptok.h preproc.h regs.h version.h
255 regdis.$(O): regdis.c
256 regflags.$(O): regflags.c
257 regs.$(O): regs.c
258 regvals.$(O): regvals.c
259 stdscan.$(O): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
260  stdscan.h tokens.h version.h
261 sync.$(O): sync.c compiler.h nasmlib.h sync.h
262 tokhash.$(O): tokhash.c compiler.h insns.h insnsi.h nasm.h nasmlib.h regs.h \
263  tokens.h version.h