3 # Auto-configuring Makefile for the Netwide Assembler.
5 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
6 # Julian Hall. All rights reserved. The software is
7 # redistributable under the licence given in the file "Licence"
8 # distributed in the NASM archive.
13 exec_prefix = @
exec_prefix@
19 BUILD_CFLAGS
= $(CFLAGS
) @GCCFLAGS@ @DEFS@
20 INTERNAL_CFLAGS
= -I
$(srcdir) -I.
21 ALL_CFLAGS
= $(BUILD_CFLAGS
) $(INTERNAL_CFLAGS
)
27 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
28 INSTALL_DATA
= @INSTALL_DATA@
36 .SUFFIXES
: .c .i .s .
$(O
) .1 .man
38 .PHONY
: all doc rdf
install clean distclean cleaner spotless install_rdf
39 .PHONY
: install_doc everything install_everything
strip perlreq
dist
42 $(CC
) -c
$(ALL_CFLAGS
) -o
$@
$<
45 $(CC
) -S
$(ALL_CFLAGS
) -o
$@
$<
48 $(CC
) -E
$(ALL_CFLAGS
) -o
$@
$<
53 NASM
= nasm.
$(O
) nasmlib.
$(O
) float.
$(O
) insnsa.
$(O
) assemble.
$(O
) \
54 labels.
$(O
) parser.
$(O
) outform.
$(O
) output
/outbin.
$(O
) \
55 output
/outaout.
$(O
) output
/outcoff.
$(O
) output
/outelf.
$(O
) \
56 output
/outobj.
$(O
) output
/outas86.
$(O
) output
/outrdf2.
$(O
) \
57 output
/outdbg.
$(O
) output
/outieee.
$(O
) output
/outmacho.
$(O
) \
58 preproc.
$(O
) listing.
$(O
) eval.
$(O
)
60 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) insnsd.
$(O
)
62 all: nasm
$(X
) ndisasm
$(X
) nasm.man ndisasm.man
63 cd rdoff
&& $(MAKE
) all
66 $(CC
) $(LDFLAGS
) -o nasm
$(X
) $(NASM
) $(LIBS
)
68 ndisasm
$(X
): $(NDISASM
)
69 $(CC
) $(LDFLAGS
) -o ndisasm
$(X
) $(NDISASM
) $(LIBS
)
71 # These source files are automagically generated from a single
72 # instruction-table file by a Perl script. They're distributed,
73 # though, so it isn't necessary to have Perl just to recompile NASM
74 # from the distribution.
76 insnsa.c
: insns.dat insns.pl
77 $(PERL
) $(srcdir)/insns.pl
-a
$(srcdir)/insns.dat
78 insnsd.c
: insns.dat insns.pl
79 $(PERL
) $(srcdir)/insns.pl
-d
$(srcdir)/insns.dat
80 insnsi.h
: insns.dat insns.pl
81 $(PERL
) $(srcdir)/insns.pl
-i
$(srcdir)/insns.dat
82 insnsn.c
: insns.dat insns.pl
83 $(PERL
) $(srcdir)/insns.pl
-n
$(srcdir)/insns.dat
85 # These files contains all the standard macros that are derived from
87 version.h
: version version.pl
88 $(PERL
) $(srcdir)/version.pl h
< $(srcdir)/version
> version.h
90 version.mac
: version version.pl
91 $(PERL
) $(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
93 # This source file is generated from the standard macros file
94 # `standard.mac' by another Perl script. Again, it's part of the
95 # standard distribution.
97 macros.c
: macros.pl standard.mac version.mac
98 $(PERL
) $(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac
100 # These source files are generated from regs.dat by yet another
102 regs.c
: regs.dat regs.pl
103 $(PERL
) $(srcdir)/regs.pl c
$(srcdir)/regs.dat
> regs.c
104 regflags.c
: regs.dat regs.pl
105 $(PERL
) $(srcdir)/regs.pl
fc $(srcdir)/regs.dat
> regflags.c
106 regdis.c
: regs.dat regs.pl
107 $(PERL
) $(srcdir)/regs.pl dc
$(srcdir)/regs.dat
> regdis.c
108 regvals.c
: regs.dat regs.pl
109 $(PERL
) $(srcdir)/regs.pl vc
$(srcdir)/regs.dat
> regvals.c
110 regs.h
: regs.dat regs.pl
111 $(PERL
) $(srcdir)/regs.pl h
$(srcdir)/regs.dat
> regs.h
113 # This target generates all files that require perl.
114 # This allows easier generation of distribution (see dist target).
115 PERLREQ
= macros.c insnsa.c insnsd.c insnsi.h insnsn.c \
116 regs.c regs.h regflags.c regdis.c regvals.c \
117 version.h version.mac
120 install: nasm
$(X
) ndisasm
$(X
)
121 $(INSTALL_PROGRAM
) nasm
$(X
) $(INSTALLROOT
)$(bindir)/nasm
$(X
)
122 $(INSTALL_PROGRAM
) ndisasm
$(X
) $(INSTALLROOT
)$(bindir)/ndisasm
$(X
)
123 $(INSTALL_DATA
) $(srcdir)/nasm
.1 $(INSTALLROOT
)$(mandir)/man1
/nasm
.1
124 $(INSTALL_DATA
) $(srcdir)/ndisasm
.1 $(INSTALLROOT
)$(mandir)/man1
/ndisasm
.1
128 rm -f output
/*.
$(O
) output
/*.s output
/*.i
129 rm -f nasm
$(X
) ndisasm
$(X
)
130 cd rdoff
&& $(MAKE
) clean
133 rm -f config.h config.log config.status
134 rm -f Makefile
*~
*.bak
*.lst
*.bin
135 rm -f output
/*~ output
/*.bak
136 rm -f
test/*.lst
test/*.bin
test/*.
$(O
) test/*.bin
137 rm -rf autom4te
*.cache
138 cd rdoff
&& $(MAKE
) distclean
141 rm -f
$(PERLREQ
) *.man nasm.spec
142 cd doc
&& $(MAKE
) clean
144 spotless
: distclean cleaner
145 rm -f doc
/Makefile doc
/*~ doc
/*.bak
148 strip --strip-unneeded nasm
$(X
) ndisasm
$(X
)
153 rdf_install install_rdf
:
154 cd rdoff
&& $(MAKE
) install
157 cd doc
&& $(MAKE
) all
159 doc_install install_doc
:
160 cd doc
&& $(MAKE
) install
162 everything
: all doc rdf
164 install_everything
: everything
install install_doc install_rdf
166 dist: spotless perlreq spec
169 rm -rf .
/autom4te
*.cache
172 tar cvjf ..
/nasm-
`cat version`-`date +%Y%m%d`.
tar.bz2 ..
/`./nasm-dir`
176 nasm.spec
: nasm.spec.in version version.pl
177 sed
-e s
/@@VERSION@@
/`cat $(srcdir)/version`/g \
178 -e s
/@@ID@@
/`$(PERL) $(srcdir)/version.pl id < $(srcdir)/version`/g \
179 < nasm.spec.in
> nasm.spec
185 # This build dependencies in *ALL* makefiles. Partially for that reason,
186 # it's expected to be invoked manually.
189 $(PERL
) mkdep.pl
-M Makefile.in Mkfiles
/Makefile.
* -- \
193 #-- Magic hints to mkdep.pl --#
194 # @object-ending: ".$(O)"
195 # @path-separator: "/"
196 #-- Everything below is generated by mkdep.pl - do not edit --#
197 assemble.
$(O
): assemble.c preproc.h insns.h regs.h version.h nasmlib.h \
198 nasm.h regvals.c assemble.h insnsi.h
199 disasm.
$(O
): disasm.c insns.h sync.h regdis.c regs.h regs.c version.h nasm.h \
200 insnsn.c names.c insnsi.h disasm.h
201 eval.
$(O
): eval.c labels.h eval.h regs.h version.h nasmlib.h nasm.h
202 float.
$(O
): float.c regs.h version.h nasm.h
203 insnsa.
$(O
): insnsa.c insns.h regs.h version.h nasm.h insnsi.h
204 insnsd.
$(O
): insnsd.c insns.h regs.h version.h nasm.h insnsi.h
205 insnsn.
$(O
): insnsn.c
206 labels.
$(O
): labels.c regs.h version.h nasmlib.h nasm.h
207 listing.
$(O
): listing.c regs.h version.h nasmlib.h nasm.h listing.h
208 macros.
$(O
): macros.c
209 names.
$(O
): names.c regs.c insnsn.c
210 nasm.
$(O
): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
211 outform.h version.h nasmlib.h nasm.h assemble.h insnsi.h listing.h
212 nasmlib.
$(O
): nasmlib.c insns.h regs.h regs.c version.h nasmlib.h nasm.h \
213 insnsn.c names.c insnsi.h
214 ndisasm.
$(O
): ndisasm.c insns.h sync.h regs.h version.h nasmlib.h nasm.h \
216 outform.
$(O
): outform.c regs.h outform.h version.h nasm.h
217 output
/outaout.
$(O
): output
/outaout.c regs.h outform.h version.h nasmlib.h \
219 output
/outas86.
$(O
): output
/outas86.c regs.h outform.h version.h nasmlib.h \
221 output
/outbin.
$(O
): output
/outbin.c labels.h eval.h regs.h outform.h \
222 version.h nasmlib.h nasm.h
223 output
/outcoff.
$(O
): output
/outcoff.c regs.h outform.h version.h nasmlib.h \
225 output
/outdbg.
$(O
): output
/outdbg.c regs.h outform.h version.h nasmlib.h \
227 output
/outelf.
$(O
): output
/outelf.c regs.h outform.h version.h nasmlib.h \
229 output
/outieee.
$(O
): output
/outieee.c regs.h outform.h version.h nasmlib.h \
231 output
/outobj.
$(O
): output
/outobj.c regs.h outform.h version.h nasmlib.h \
233 output
/outrdf.
$(O
): output
/outrdf.c regs.h outform.h version.h nasmlib.h \
235 output
/outrdf2.
$(O
): output
/outrdf2.c rdoff
/rdoff.h regs.h outform.h \
236 version.h nasmlib.h nasm.h
237 parser.
$(O
): parser.c insns.h parser.h float.h regs.h regflags.c version.h \
238 nasmlib.h nasm.h insnsi.h
239 preproc.
$(O
): preproc.c macros.c regs.h version.h nasmlib.h nasm.h
240 regdis.
$(O
): regdis.c
241 regflags.
$(O
): regflags.c
243 regvals.
$(O
): regvals.c
244 sync.
$(O
): sync.c sync.h