3 # Makefile for building NASM using OpenWatcom 1.7
4 # building on a DOS/Win/OS2 platform host (backslashes
11 prefix = C
:\Program Files\NASM
12 exec_prefix = $(prefix)
13 bindir = $(prefix)\bin
14 mandir = $(prefix)\man
18 CFLAGS
= -6 -ox
-wx
-ze
-fpi
$(DEBUG
)
19 BUILD_CFLAGS
= $(CFLAGS
) $(TARGET_FLAGS
) # -I$(srcdir)/inttypes
20 INTERNAL_CFLAGS
= -I
$(srcdir) -I.
-DHAVE_SNPRINTF
-DHAVE_VSNPRINTF
21 ALL_CFLAGS
= $(BUILD_CFLAGS
) $(INTERNAL_CFLAGS
)
23 LDFLAGS
= $(ALL_CFLAGS
)
25 PERL
= perl
-I
$(srcdir)/perllib
33 # WMAKE errors out if a suffix is declared more than once, including
34 # its own built-in declarations. Thus, we need to explicitly clear the list
35 # first. Also, WMAKE only allows implicit rules that point "to the left"
38 .SUFFIXES
: .man
.1 .
$(O
) .i .c
40 # Needed to find C files anywhere but in the current directory
44 $(CC
) -c
$(ALL_CFLAGS
) -fo
=$^@
$[@
46 # Note: wcl386 is broken if forward slashes are used as path separators.
47 #-- Begin File Lists --#
48 # Edit in Makefile.in, not here!
49 NASM
= nasm.
$(O
) nasmlib.
$(O
) ver.
$(O
) &
50 raa.
$(O
) saa.
$(O
) rbtree.
$(O
) &
51 float.
$(O
) insnsa.
$(O
) insnsb.
$(O
) &
52 assemble.
$(O
) labels.
$(O
) hashtbl.
$(O
) crc64.
$(O
) parser.
$(O
) &
53 outform.
$(O
) outlib.
$(O
) output\outbin.
$(O
) &
54 output\outaout.
$(O
) output\outcoff.
$(O
) &
55 output\outelf32.
$(O
) output\outelf64.
$(O
) &
56 output\outobj.
$(O
) output\outas86.
$(O
) output\outrdf2.
$(O
) &
57 output\outdbg.
$(O
) output\outieee.
$(O
) output\outmacho.
$(O
) &
58 preproc.
$(O
) quote.
$(O
) pptok.
$(O
) macros.
$(O
) &
59 listing.
$(O
) eval.
$(O
) exprlib.
$(O
) stdscan.
$(O
) strfunc.
$(O
) &
60 tokhash.
$(O
) regvals.
$(O
) regflags.
$(O
)
62 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) ver.
$(O
) &
63 insnsd.
$(O
) insnsb.
$(O
) insnsn.
$(O
) regs.
$(O
) regdis.
$(O
)
64 #-- End File Lists --#
67 @echo Please build
"dos", "win32" or
"os2"
70 $(MAKE
) /f
$(__MAKEFILES__
) all TARGET_FLAGS
="-bt=DOS -l=DOS4G"
73 $(MAKE
) /f
$(__MAKEFILES__
) all TARGET_FLAGS
="-bt=NT -l=NT"
76 $(MAKE
) /f
$(__MAKEFILES__
) all TARGET_FLAGS
="-bt=OS2 -l=OS2V2"
78 all: nasm
$(X
) ndisasm
$(X
) .SYMBOLIC
79 rem cd rdoff
&& $(MAKE
) all
82 $(LD
) $(LDFLAGS
) -fe
=nasm
$(X
) $(NASM
) $(LIBS
)
84 ndisasm
$(X
): $(NDISASM
)
85 $(LD
) $(LDFLAGS
) -fe
=ndisasm
$(X
) $(NDISASM
) $(LIBS
)
87 # These source files are automagically generated from a single
88 # instruction-table file by a Perl script. They're distributed,
89 # though, so it isn't necessary to have Perl just to recompile NASM
90 # from the distribution.
92 insnsb.c
: insns.dat insns.pl
93 $(PERL
) $(srcdir)/insns.pl
-b
$(srcdir)/insns.dat
94 insnsa.c
: insns.dat insns.pl
95 $(PERL
) $(srcdir)/insns.pl
-a
$(srcdir)/insns.dat
96 insnsd.c
: insns.dat insns.pl
97 $(PERL
) $(srcdir)/insns.pl
-d
$(srcdir)/insns.dat
98 insnsi.h
: insns.dat insns.pl
99 $(PERL
) $(srcdir)/insns.pl
-i
$(srcdir)/insns.dat
100 insnsn.c
: insns.dat insns.pl
101 $(PERL
) $(srcdir)/insns.pl
-n
$(srcdir)/insns.dat
103 # These files contains all the standard macros that are derived from
104 # the version number.
105 version.h
: version version.pl
106 $(PERL
) $(srcdir)/version.pl h
< $(srcdir)/version
> version.h
108 version.mac
: version version.pl
109 $(PERL
) $(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
111 # This source file is generated from the standard macros file
112 # `standard.mac' by another Perl script. Again, it's part of the
113 # standard distribution.
115 macros.c
: macros.pl standard.mac version.mac
116 $(PERL
) $(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac
118 # These source files are generated from regs.dat by yet another
120 regs.c
: regs.dat regs.pl
121 $(PERL
) $(srcdir)/regs.pl c
$(srcdir)/regs.dat
> regs.c
122 regflags.c
: regs.dat regs.pl
123 $(PERL
) $(srcdir)/regs.pl
fc $(srcdir)/regs.dat
> regflags.c
124 regdis.c
: regs.dat regs.pl
125 $(PERL
) $(srcdir)/regs.pl dc
$(srcdir)/regs.dat
> regdis.c
126 regdis.h
: regs.dat regs.pl
127 $(PERL
) $(srcdir)/regs.pl dh
$(srcdir)/regs.dat
> regdis.h
128 regvals.c
: regs.dat regs.pl
129 $(PERL
) $(srcdir)/regs.pl vc
$(srcdir)/regs.dat
> regvals.c
130 regs.h
: regs.dat regs.pl
131 $(PERL
) $(srcdir)/regs.pl h
$(srcdir)/regs.dat
> regs.h
133 # Assembler token hash
134 tokhash.c
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
135 $(PERL
) $(srcdir)/tokhash.pl c
$(srcdir)/insns.dat
$(srcdir)/regs.dat
&
136 $(srcdir)/tokens.dat
> tokhash.c
138 # Assembler token metadata
139 tokens.h
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
140 $(PERL
) $(srcdir)/tokhash.pl h
$(srcdir)/insns.dat
$(srcdir)/regs.dat
&
141 $(srcdir)/tokens.dat
> tokens.h
143 # Preprocessor token hash
144 pptok.h
: pptok.dat pptok.pl perllib
/phash.ph
145 $(PERL
) $(srcdir)/pptok.pl h
$(srcdir)/pptok.dat pptok.h
146 pptok.c
: pptok.dat pptok.pl perllib
/phash.ph
147 $(PERL
) $(srcdir)/pptok.pl c
$(srcdir)/pptok.dat pptok.c
149 # This target generates all files that require perl.
150 # This allows easier generation of distribution (see dist target).
151 PERLREQ
= macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c
&
152 regs.c regs.h regflags.c regdis.c regdis.h regvals.c
&
153 tokhash.c tokens.h pptok.h pptok.c
&
154 version.h version.mac
161 -del
/f output\
*.
$(O
)
166 rem cd rdoff
&& $(MAKE
) clean
168 distclean: clean .SYMBOLIC
171 -del
/f config.status
183 -del
/f
/s autom4te
*.cache
184 rem cd rdoff
&& $(MAKE
) distclean
186 cleaner
: clean .SYMBOLIC
190 rem cd doc
&& $(MAKE
) clean
192 spotless
: distclean cleaner .SYMBOLIC
201 # cd rdoff && $(MAKE)
204 # cd doc && $(MAKE) all
206 everything
: all doc rdf
208 #-- Magic hints to mkdep.pl --#
209 # @object-ending: ".$(O)"
210 # @path-separator: "\"
211 # @exclude: "config.h"
213 #-- Everything below is generated by mkdep.pl - do not edit --#
214 assemble.
$(O
): assemble.c assemble.h compiler.h insns.h insnsi.h nasm.h
&
215 nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h
216 crc64.
$(O
): crc64.c compiler.h nasmlib.h
217 disasm.
$(O
): disasm.c compiler.h disasm.h insns.h insnsi.h nasm.h nasmlib.h
&
218 pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h
219 eval.
$(O
): eval.c compiler.h eval.h float.h insnsi.h labels.h nasm.h
&
220 nasmlib.h pptok.h preproc.h regs.h
221 exprlib.
$(O
): exprlib.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h
&
223 float.
$(O
): float.c compiler.h float.h insnsi.h nasm.h nasmlib.h pptok.h
&
225 hashtbl.
$(O
): hashtbl.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h
&
226 pptok.h preproc.h regs.h
227 insnsa.
$(O
): insnsa.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h
&
228 preproc.h regs.h tokens.h
229 insnsb.
$(O
): insnsb.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h
&
230 preproc.h regs.h tokens.h
231 insnsd.
$(O
): insnsd.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h
&
232 preproc.h regs.h tokens.h
233 insnsn.
$(O
): insnsn.c compiler.h insnsi.h tables.h
234 labels.
$(O
): labels.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h pptok.h
&
236 lib\snprintf.
$(O
): lib\snprintf.c compiler.h nasmlib.h
237 lib
\vsnprintf.
$(O
): lib
\vsnprintf.c compiler.h nasmlib.h
238 listing.
$(O
): listing.c compiler.h insnsi.h listing.h nasm.h nasmlib.h
&
239 pptok.h preproc.h regs.h
240 macros.
$(O
): macros.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h
&
241 outform.h pptok.h preproc.h regs.h tables.h
242 nasm.
$(O
): nasm.c assemble.h compiler.h eval.h float.h insns.h insnsi.h
&
243 labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h preproc.h
&
244 raa.h regs.h saa.h stdscan.h tokens.h
245 nasmlib.
$(O
): nasmlib.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h
&
246 preproc.h regs.h tokens.h
247 ndisasm.
$(O
): ndisasm.c compiler.h disasm.h insns.h insnsi.h nasm.h
&
248 nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h
249 outform.
$(O
): outform.c compiler.h insnsi.h nasm.h nasmlib.h outform.h
&
250 pptok.h preproc.h regs.h
251 outlib.
$(O
): outlib.c compiler.h insnsi.h nasm.h nasmlib.h outlib.h pptok.h
&
253 output\outaout.
$(O
): output\outaout.c compiler.h insnsi.h nasm.h nasmlib.h
&
254 outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h
255 output\outas86.
$(O
): output\outas86.c compiler.h insnsi.h nasm.h nasmlib.h
&
256 outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
257 output\outbin.
$(O
): output\outbin.c compiler.h eval.h insnsi.h labels.h
&
258 nasm.h nasmlib.h outform.h outlib.h pptok.h preproc.h regs.h saa.h
&
260 output\outcoff.
$(O
): output\outcoff.c compiler.h insnsi.h nasm.h nasmlib.h
&
261 outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
262 output\outdbg.
$(O
): output\outdbg.c compiler.h insnsi.h nasm.h nasmlib.h
&
263 outform.h pptok.h preproc.h regs.h
264 output\outelf32.
$(O
): output\outelf32.c compiler.h insnsi.h nasm.h nasmlib.h
&
265 outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
266 output\outelf64.
$(O
): output\outelf64.c compiler.h insnsi.h nasm.h nasmlib.h
&
267 outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
268 output\outieee.
$(O
): output\outieee.c compiler.h insnsi.h nasm.h nasmlib.h
&
269 outform.h pptok.h preproc.h regs.h
270 output\outmacho.
$(O
): output\outmacho.c compiler.h insnsi.h nasm.h nasmlib.h
&
271 outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h
272 output\outobj.
$(O
): output\outobj.c compiler.h insnsi.h nasm.h nasmlib.h
&
273 outform.h pptok.h preproc.h regs.h stdscan.h
274 output\outrdf.
$(O
): output\outrdf.c compiler.h insnsi.h nasm.h nasmlib.h
&
275 outform.h pptok.h preproc.h regs.h
276 output\outrdf2.
$(O
): output\outrdf2.c compiler.h insnsi.h nasm.h nasmlib.h
&
277 outform.h pptok.h preproc.h rdoff
\rdoff.h regs.h saa.h
278 parser.
$(O
): parser.c compiler.h float.h insns.h insnsi.h nasm.h nasmlib.h
&
279 parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h
280 pptok.
$(O
): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h
281 preproc.
$(O
): preproc.c compiler.h hashtbl.h insnsi.h nasm.h nasmlib.h
&
282 pptok.h preproc.h quote.h regs.h stdscan.h tables.h tokens.h
283 quote.
$(O
): quote.c compiler.h nasmlib.h quote.h
284 raa.
$(O
): raa.c compiler.h nasmlib.h raa.h
285 rbtree.
$(O
): rbtree.c compiler.h rbtree.h
286 regdis.
$(O
): regdis.c regdis.h regs.h
287 regflags.
$(O
): regflags.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h
&
288 preproc.h regs.h tables.h
289 regs.
$(O
): regs.c compiler.h insnsi.h tables.h
290 regvals.
$(O
): regvals.c compiler.h insnsi.h tables.h
291 saa.
$(O
): saa.c compiler.h nasmlib.h saa.h
292 stdscan.
$(O
): stdscan.c compiler.h insns.h insnsi.h nasm.h nasmlib.h pptok.h
&
293 preproc.h quote.h regs.h stdscan.h tokens.h
294 strfunc.
$(O
): strfunc.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h
&
296 sync.
$(O
): sync.c compiler.h nasmlib.h sync.h
297 tokhash.
$(O
): tokhash.c compiler.h hashtbl.h insns.h insnsi.h nasm.h
&
298 nasmlib.h pptok.h preproc.h regs.h tokens.h
299 ver.
$(O
): ver.c compiler.h insnsi.h nasm.h nasmlib.h pptok.h preproc.h
&