2 # Auto-configuring Makefile for the Netwide Assembler.
4 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
5 # Julian Hall. All rights reserved. The software is
6 # redistributable under the license given in the file "LICENSE"
7 # distributed in the NASM archive.
9 top_srcdir
= @top_srcdir@
13 exec_prefix = @
exec_prefix@
16 datarootdir
= @datarootdir@
20 BUILD_CFLAGS
= $(CFLAGS
) @DEFS@
21 INTERNAL_CFLAGS
= -I
$(srcdir) -I.
22 ALL_CFLAGS
= $(BUILD_CFLAGS
) $(INTERNAL_CFLAGS
)
25 PERL
= perl
-I
$(srcdir)/perllib
30 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
31 INSTALL_DATA
= @INSTALL_DATA@
44 .SUFFIXES
: .c .i .s .
$(O
) .1 .man
46 .PHONY
: all doc rdf
install clean distclean cleaner spotless install_rdf
47 .PHONY
: install_doc everything install_everything
strip perlreq
dist
50 $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$<
53 $(CC
) -S
$(ALL_CFLAGS
) -o
$@
$<
56 $(CC
) -E
$(ALL_CFLAGS
) -o
$@
$<
61 #-- Begin File Lists --#
62 NASM
= nasm.
$(O
) nasmlib.
$(O
) raa.
$(O
) saa.
$(O
) \
63 float.
$(O
) insnsa.
$(O
) insnsb.
$(O
) \
64 assemble.
$(O
) labels.
$(O
) hashtbl.
$(O
) crc64.
$(O
) parser.
$(O
) \
65 outform.
$(O
) output
/outbin.
$(O
) \
66 output
/outaout.
$(O
) output
/outcoff.
$(O
) \
67 output
/outelf32.
$(O
) output
/outelf64.
$(O
) \
68 output
/outobj.
$(O
) output
/outas86.
$(O
) output
/outrdf2.
$(O
) \
69 output
/outdbg.
$(O
) output
/outieee.
$(O
) output
/outmacho.
$(O
) \
70 preproc.
$(O
) quote.
$(O
) pptok.
$(O
) macros.
$(O
) \
71 listing.
$(O
) eval.
$(O
) exprlib.
$(O
) stdscan.
$(O
) strfunc.
$(O
) \
72 tokhash.
$(O
) regvals.
$(O
) regflags.
$(O
)
74 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) \
75 insnsd.
$(O
) insnsb.
$(O
) insnsn.
$(O
) regs.
$(O
) regdis.
$(O
)
76 #-- End File Lists --#
78 all: nasm
$(X
) ndisasm
$(X
) nasm.man ndisasm.man
79 cd rdoff
&& $(MAKE
) all
81 nasm
$(X
): $(NASM
) $(XOBJS
)
82 $(CC
) $(LDFLAGS
) -o nasm
$(X
) $(NASM
) $(XOBJS
) $(LIBS
)
84 ndisasm
$(X
): $(NDISASM
) $(XOBJS
)
85 $(CC
) $(LDFLAGS
) -o ndisasm
$(X
) $(NDISASM
) $(XOBJS
) $(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
107 version.mac
: version version.pl
108 $(PERL
) $(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
109 version.sed
: version version.pl
110 $(PERL
) $(srcdir)/version.pl sed
< $(srcdir)/version
> version.sed
111 version.mak
: version version.pl
112 $(PERL
) $(srcdir)/version.pl make
< $(srcdir)/version
> version.mak
114 # This source file is generated from the standard macros file
115 # `standard.mac' by another Perl script. Again, it's part of the
116 # standard distribution.
117 macros.c
: macros.pl pptok.ph standard.mac version.mac \
118 $(srcdir)/macros
/*.mac
$(srcdir)/output
/*.mac
119 $(PERL
) $(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac \
120 $(srcdir)/macros
/*.mac
$(srcdir)/output
/*.mac
122 # These source files are generated from regs.dat by yet another
124 regs.c
: regs.dat regs.pl
125 $(PERL
) $(srcdir)/regs.pl c
$(srcdir)/regs.dat
> regs.c
126 regflags.c
: regs.dat regs.pl
127 $(PERL
) $(srcdir)/regs.pl
fc $(srcdir)/regs.dat
> regflags.c
128 regdis.c
: regs.dat regs.pl
129 $(PERL
) $(srcdir)/regs.pl dc
$(srcdir)/regs.dat
> regdis.c
130 regdis.h
: regs.dat regs.pl
131 $(PERL
) $(srcdir)/regs.pl dh
$(srcdir)/regs.dat
> regdis.h
132 regvals.c
: regs.dat regs.pl
133 $(PERL
) $(srcdir)/regs.pl vc
$(srcdir)/regs.dat
> regvals.c
134 regs.h
: regs.dat regs.pl
135 $(PERL
) $(srcdir)/regs.pl h
$(srcdir)/regs.dat
> regs.h
137 # Assembler token hash
138 tokhash.c
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
139 $(PERL
) $(srcdir)/tokhash.pl c
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
140 $(srcdir)/tokens.dat
> tokhash.c
142 # Assembler token metadata
143 tokens.h
: insns.dat regs.dat tokens.dat tokhash.pl perllib
/phash.ph
144 $(PERL
) $(srcdir)/tokhash.pl h
$(srcdir)/insns.dat
$(srcdir)/regs.dat \
145 $(srcdir)/tokens.dat
> tokens.h
147 # Preprocessor token hash
148 pptok.h
: pptok.dat pptok.pl perllib
/phash.ph
149 $(PERL
) $(srcdir)/pptok.pl h
$(srcdir)/pptok.dat pptok.h
150 pptok.c
: pptok.dat pptok.pl perllib
/phash.ph
151 $(PERL
) $(srcdir)/pptok.pl c
$(srcdir)/pptok.dat pptok.c
152 pptok.ph
: pptok.dat pptok.pl perllib
/phash.ph
153 $(PERL
) $(srcdir)/pptok.pl ph
$(srcdir)/pptok.dat pptok.ph
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 pptok.ph \
160 version.h version.mac version.mak
163 install: nasm
$(X
) ndisasm
$(X
)
164 $(MKDIR
) -p
$(INSTALLROOT
)$(bindir)
165 $(INSTALL_PROGRAM
) nasm
$(X
) $(INSTALLROOT
)$(bindir)/nasm
$(X
)
166 $(INSTALL_PROGRAM
) ndisasm
$(X
) $(INSTALLROOT
)$(bindir)/ndisasm
$(X
)
167 $(MKDIR
) -p
$(INSTALLROOT
)$(mandir)/man1
168 $(INSTALL_DATA
) $(srcdir)/nasm
.1 $(INSTALLROOT
)$(mandir)/man1
/nasm
.1
169 $(INSTALL_DATA
) $(srcdir)/ndisasm
.1 $(INSTALLROOT
)$(mandir)/man1
/ndisasm
.1
172 $(RM
) -f
*.
$(O
) *.s
*.i
173 $(RM
) -f output
/*.
$(O
) output
/*.s output
/*.i
174 $(RM
) -f nasm
$(X
) ndisasm
$(X
)
175 cd rdoff
&& $(MAKE
) clean
178 $(RM
) -f config.h config.log config.status
179 $(RM
) -f Makefile
*~
*.bak
*.lst
*.bin
180 $(RM
) -f output
/*~ output
/*.bak
181 $(RM
) -f
test/*.lst
test/*.bin
test/*.
$(O
) test/*.bin
182 $(RM
) -rf autom4te
*.cache
183 cd rdoff
&& $(MAKE
) distclean
186 $(RM
) -f
$(PERLREQ
) *.man nasm.spec
187 cd doc
&& $(MAKE
) clean
189 spotless
: distclean cleaner
190 $(RM
) -f doc
/Makefile doc
/*~ doc
/*.bak
193 $(STRIP
) --strip-unneeded nasm
$(X
) ndisasm
$(X
)
198 rdf_install install_rdf
:
199 cd rdoff
&& $(MAKE
) install
202 cd doc
&& $(MAKE
) all
204 doc_install install_doc
:
205 cd doc
&& $(MAKE
) install
207 everything
: all doc rdf
209 install_everything
: everything
install install_doc install_rdf
211 dist: spotless perlreq spec
214 $(RM
) -rf .
/autom4te
*.cache
217 tar -cvj
--exclude CVS
-C ..
-f ..
/nasm-
`cat version`-`date +%Y%m%d`.
tar.bz2
`basename \`pwd\
``
221 nasm.spec
: nasm.spec.in version.sed
222 sed
-f version.sed
< nasm.spec.in
> nasm.spec
228 cd
test && $(PERL
) performtest.pl
--nasm
=..
/nasm
*.asm
231 # This build dependencies in *ALL* makefiles. Partially for that reason,
232 # it's expected to be invoked manually.
235 $(PERL
) syncfiles.pl Makefile.in Mkfiles
/*.mak
236 $(PERL
) mkdep.pl
-M Makefile.in Mkfiles
/*.mak
-- \
240 #-- Magic hints to mkdep.pl --#
241 # @object-ending: ".$(O)"
242 # @path-separator: "/"
243 #-- Everything below is generated by mkdep.pl - do not edit --#
244 assemble.
$(O
): assemble.c assemble.h compiler.h config.h insns.h insnsi.h \
245 nasm.h nasmlib.h pptok.h preproc.h regs.h tables.h tokens.h version.h
246 crc64.
$(O
): crc64.c compiler.h config.h nasmlib.h
247 disasm.
$(O
): disasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
248 nasmlib.h pptok.h preproc.h regdis.h regs.h sync.h tables.h tokens.h \
250 eval.
$(O
): eval.c compiler.h config.h eval.h float.h insnsi.h labels.h \
251 nasm.h nasmlib.h pptok.h preproc.h regs.h version.h
252 exprlib.
$(O
): exprlib.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
253 pptok.h preproc.h regs.h version.h
254 float.
$(O
): float.c compiler.h config.h float.h insnsi.h nasm.h nasmlib.h \
255 pptok.h preproc.h regs.h version.h
256 hashtbl.
$(O
): hashtbl.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
257 nasmlib.h pptok.h preproc.h regs.h version.h
258 insnsa.
$(O
): insnsa.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
259 pptok.h preproc.h regs.h tokens.h version.h
260 insnsb.
$(O
): insnsb.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
261 pptok.h preproc.h regs.h tokens.h version.h
262 insnsd.
$(O
): insnsd.c compiler.h config.h insns.h insnsi.h nasm.h nasmlib.h \
263 pptok.h preproc.h regs.h tokens.h version.h
264 insnsn.
$(O
): insnsn.c compiler.h config.h insnsi.h tables.h
265 labels.
$(O
): labels.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
266 nasmlib.h pptok.h preproc.h regs.h version.h
267 lib
/snprintf.
$(O
): lib
/snprintf.c compiler.h config.h nasmlib.h
268 lib
/vsnprintf.
$(O
): lib
/vsnprintf.c compiler.h config.h nasmlib.h
269 listing.
$(O
): listing.c compiler.h config.h insnsi.h listing.h nasm.h \
270 nasmlib.h pptok.h preproc.h regs.h version.h
271 macros.
$(O
): macros.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
272 nasmlib.h outform.h pptok.h preproc.h regs.h tables.h version.h
273 nasm.
$(O
): nasm.c assemble.h compiler.h config.h eval.h float.h insns.h \
274 insnsi.h labels.h listing.h nasm.h nasmlib.h outform.h parser.h pptok.h \
275 preproc.h raa.h regs.h saa.h stdscan.h tokens.h version.h
276 nasmlib.
$(O
): nasmlib.c compiler.h config.h insns.h insnsi.h nasm.h \
277 nasmlib.h pptok.h preproc.h regs.h tokens.h version.h
278 ndisasm.
$(O
): ndisasm.c compiler.h config.h disasm.h insns.h insnsi.h nasm.h \
279 nasmlib.h pptok.h preproc.h regs.h sync.h tokens.h version.h
280 outform.
$(O
): outform.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
281 outform.h pptok.h preproc.h regs.h version.h
282 output
/outaout.
$(O
): output
/outaout.c compiler.h config.h insnsi.h nasm.h \
283 nasmlib.h outform.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h \
285 output
/outas86.
$(O
): output
/outas86.c compiler.h config.h insnsi.h nasm.h \
286 nasmlib.h outform.h pptok.h preproc.h raa.h regs.h saa.h version.h
287 output
/outbin.
$(O
): output
/outbin.c compiler.h config.h eval.h insnsi.h \
288 labels.h nasm.h nasmlib.h outform.h pptok.h preproc.h regs.h saa.h \
290 output
/outcoff.
$(O
): output
/outcoff.c compiler.h config.h insnsi.h nasm.h \
291 nasmlib.h outform.h pptok.h preproc.h raa.h regs.h saa.h version.h
292 output
/outdbg.
$(O
): output
/outdbg.c compiler.h config.h insnsi.h nasm.h \
293 nasmlib.h outform.h pptok.h preproc.h regs.h version.h
294 output
/outelf32.
$(O
): output
/outelf32.c compiler.h config.h insnsi.h nasm.h \
295 nasmlib.h outform.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h \
297 output
/outelf64.
$(O
): output
/outelf64.c compiler.h config.h insnsi.h nasm.h \
298 nasmlib.h outform.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h \
300 output
/outieee.
$(O
): output
/outieee.c compiler.h config.h insnsi.h nasm.h \
301 nasmlib.h outform.h pptok.h preproc.h regs.h version.h
302 output
/outmacho.
$(O
): output
/outmacho.c compiler.h config.h insnsi.h nasm.h \
303 nasmlib.h outform.h pptok.h preproc.h raa.h regs.h saa.h version.h
304 output
/outobj.
$(O
): output
/outobj.c compiler.h config.h insnsi.h nasm.h \
305 nasmlib.h outform.h pptok.h preproc.h regs.h stdscan.h version.h
306 output
/outrdf.
$(O
): output
/outrdf.c compiler.h config.h insnsi.h nasm.h \
307 nasmlib.h outform.h pptok.h preproc.h regs.h version.h
308 output
/outrdf2.
$(O
): output
/outrdf2.c compiler.h config.h insnsi.h nasm.h \
309 nasmlib.h outform.h pptok.h preproc.h rdoff
/rdoff.h regs.h saa.h version.h
310 parser.
$(O
): parser.c compiler.h config.h float.h insns.h insnsi.h nasm.h \
311 nasmlib.h parser.h pptok.h preproc.h regs.h stdscan.h tables.h tokens.h \
313 pptok.
$(O
): pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h \
315 preproc.
$(O
): preproc.c compiler.h config.h hashtbl.h insnsi.h nasm.h \
316 nasmlib.h pptok.h preproc.h quote.h regs.h stdscan.h tables.h tokens.h \
318 quote.
$(O
): quote.c compiler.h config.h nasmlib.h quote.h
319 raa.
$(O
): raa.c compiler.h config.h nasmlib.h raa.h
320 regdis.
$(O
): regdis.c regdis.h regs.h
321 regflags.
$(O
): regflags.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
322 pptok.h preproc.h regs.h tables.h version.h
323 regs.
$(O
): regs.c compiler.h config.h insnsi.h tables.h
324 regvals.
$(O
): regvals.c compiler.h config.h insnsi.h tables.h
325 saa.
$(O
): saa.c compiler.h config.h nasmlib.h saa.h
326 stdscan.
$(O
): stdscan.c compiler.h config.h insns.h insnsi.h nasm.h \
327 nasmlib.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h version.h
328 strfunc.
$(O
): strfunc.c compiler.h config.h insnsi.h nasm.h nasmlib.h \
329 pptok.h preproc.h regs.h version.h
330 sync.
$(O
): sync.c compiler.h config.h nasmlib.h sync.h
331 tokhash.
$(O
): tokhash.c compiler.h config.h hashtbl.h insns.h insnsi.h \
332 nasm.h nasmlib.h pptok.h preproc.h regs.h tokens.h version.h