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@
18 CFLAGS
= @CFLAGS@ @GCCFLAGS@
-I
$(srcdir) -I.
22 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
23 INSTALL_DATA
= @INSTALL_DATA@
31 .SUFFIXES
: .c .i .s .
$(O
) .1 .man
33 .PHONY
: all doc rdf
install clean distclean cleaner spotless install_rdf
34 .PHONY
: install_doc everything install_everything
strip perlreq
dist
37 $(CC
) -c
$(CFLAGS
) -o
$@
$<
40 $(CC
) -S
$(CFLAGS
) -o
$@
$<
43 $(CC
) -E
$(CFLAGS
) -o
$@
$<
48 NASM
= nasm.
$(O
) nasmlib.
$(O
) float.
$(O
) insnsa.
$(O
) assemble.
$(O
) labels.
$(O
) \
49 parser.
$(O
) outform.
$(O
) output
/outbin.
$(O
) output
/outaout.
$(O
) output
/outcoff.
$(O
) output
/outelf.
$(O
) \
50 output
/outobj.
$(O
) output
/outas86.
$(O
) output
/outrdf2.
$(O
) output
/outdbg.
$(O
) output
/outieee.
$(O
) \
51 preproc.
$(O
) listing.
$(O
) eval.
$(O
)
53 NDISASM
= ndisasm.
$(O
) disasm.
$(O
) sync.
$(O
) nasmlib.
$(O
) insnsd.
$(O
)
55 all: nasm
$(X
) ndisasm
$(X
) nasm.man ndisasm.man
56 cd rdoff
&& $(MAKE
) all
59 $(CC
) $(LDFLAGS
) -o nasm
$(X
) $(NASM
)
61 ndisasm
$(X
): $(NDISASM
)
62 $(CC
) $(LDFLAGS
) -o ndisasm
$(X
) $(NDISASM
)
64 assemble.
$(O
): assemble.c nasm.h version.h insnsi.h nasmlib.h assemble.h insns.h
65 disasm.
$(O
): disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
66 eval.
$(O
): eval.c eval.h nasm.h version.h insnsi.h nasmlib.h
67 float.
$(O
): float.c nasm.h version.h insnsi.h
68 insnsa.
$(O
): insnsa.c nasm.h version.h insnsi.h insns.h
69 insnsd.
$(O
): insnsd.c nasm.h version.h insnsi.h insns.h
70 labels.
$(O
): labels.c nasm.h version.h insnsi.h nasmlib.h
71 listing.
$(O
): listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
72 nasm.
$(O
): nasm.c nasm.h version.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h outform.h listing.h insns.h
73 nasmlib.
$(O
): nasmlib.c nasm.h version.h insnsi.h nasmlib.h names.c insnsn.c
74 ndisasm.
$(O
): ndisasm.c nasm.h version.h insnsi.h nasmlib.h sync.h disasm.h
75 output
/outaout.
$(O
): output
/outaout.c nasm.h version.h insnsi.h nasmlib.h outform.h
76 output
/outas86.
$(O
): output
/outas86.c nasm.h version.h insnsi.h nasmlib.h outform.h
77 output
/outbin.
$(O
): output
/outbin.c nasm.h version.h insnsi.h nasmlib.h outform.h
78 output
/outcoff.
$(O
): output
/outcoff.c nasm.h version.h insnsi.h nasmlib.h outform.h
79 output
/outdbg.
$(O
): output
/outdbg.c nasm.h version.h insnsi.h nasmlib.h outform.h
80 output
/outelf.
$(O
): output
/outelf.c nasm.h version.h insnsi.h nasmlib.h outform.h
81 outform.
$(O
): outform.c outform.h nasm.h version.h insnsi.h
82 output
/outobj.
$(O
): output
/outobj.c nasm.h version.h insnsi.h nasmlib.h outform.h
83 output
/outrdf2.
$(O
): output
/outrdf2.c nasm.h version.h insnsi.h nasmlib.h outform.h
84 output
/outieee.
$(O
): output
/outieee.c nasm.h version.h insnsi.h nasmlib.h outform.h
85 parser.
$(O
): parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
86 preproc.
$(O
): preproc.c nasm.h version.h insnsi.h nasmlib.h macros.c
87 sync.
$(O
): sync.c sync.h
89 # These source files are automagically generated from a single
90 # instruction-table file by a Perl script. They're distributed,
91 # though, so it isn't necessary to have Perl just to recompile NASM
92 # from the distribution.
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 # This target generates all files that require perl.
119 # This allows easier generation of distribution (see dist target).
120 PERLREQ
= macros.c insnsa.c insnsd.c insnsi.h insnsn.c version.h version.mac
123 install: nasm
$(X
) ndisasm
$(X
)
124 $(INSTALL_PROGRAM
) nasm
$(X
) $(INSTALLROOT
)$(bindir)/nasm
$(X
)
125 $(INSTALL_PROGRAM
) ndisasm
$(X
) $(INSTALLROOT
)$(bindir)/ndisasm
$(X
)
126 $(INSTALL_DATA
) $(srcdir)/nasm
.1 $(INSTALLROOT
)$(mandir)/man1
/nasm
.1
127 $(INSTALL_DATA
) $(srcdir)/ndisasm
.1 $(INSTALLROOT
)$(mandir)/man1
/ndisasm
.1
131 rm -f output
/*.
$(O
) output
/*.s output
/*.i
132 rm -f nasm
$(X
) ndisasm
$(X
)
133 cd rdoff
&& $(MAKE
) clean
136 rm -f config.
* Makefile
*~
*.bak
*.lst
*.bin
137 rm -f output
/*~ output
/*.bak
138 rm -f
test/*.lst
test/*.bin
test/*.
$(O
) test/*.bin
139 rm -rf autom4te
*.cache
140 cd rdoff
&& $(MAKE
) distclean
143 rm -f
$(PERLREQ
) *.man nasm.spec
144 cd doc
&& $(MAKE
) clean
146 spotless
: distclean cleaner
149 strip --strip-unneeded nasm
$(X
) ndisasm
$(X
)
154 rdf_install install_rdf
:
155 cd rdoff
&& $(MAKE
) install
158 cd doc
&& $(MAKE
) all
160 doc_install install_doc
:
161 cd doc
&& $(MAKE
) install
163 everything
: all doc rdf
165 install_everything
: everything
install install_doc install_rdf
167 dist: spotless perlreq
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