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@
27 .SUFFIXES
: .c .i .s .o
.1 .man
29 .PHONY
: all doc rdf
install clean distclean cleaner spotless install_rdf
30 .PHONY
: install_doc everything install_everything
strip perlreq
dist
33 $(CC
) -c
$(CFLAGS
) -o
$@
$<
36 $(CC
) -S
$(CFLAGS
) -o
$@
$<
39 $(CC
) -E
$(CFLAGS
) -o
$@
$<
44 NASM
= nasm.o nasmlib.o float.o insnsa.o assemble.o labels.o \
45 parser.o outform.o output
/outbin.o output
/outaout.o output
/outcoff.o output
/outelf.o \
46 output
/outobj.o output
/outas86.o output
/outrdf2.o output
/outdbg.o output
/outieee.o \
47 preproc.o listing.o eval.o
49 NDISASM
= ndisasm.o disasm.o sync.o nasmlib.o insnsd.o
51 all: nasm ndisasm nasm.man ndisasm.man
52 cd rdoff
&& $(MAKE
) all
55 $(CC
) $(LDFLAGS
) -o nasm
$(NASM
)
58 $(CC
) $(LDFLAGS
) -o ndisasm
$(NDISASM
)
60 assemble.o
: assemble.c nasm.h version.h insnsi.h nasmlib.h assemble.h insns.h
61 disasm.o
: disasm.c nasm.h version.h insnsi.h disasm.h sync.h insns.h names.c insnsn.c
62 eval.o
: eval.c eval.h nasm.h version.h insnsi.h nasmlib.h
63 float.o
: float.c nasm.h version.h insnsi.h
64 insnsa.o
: insnsa.c nasm.h version.h insnsi.h insns.h
65 insnsd.o
: insnsd.c nasm.h version.h insnsi.h insns.h
66 labels.o
: labels.c nasm.h version.h insnsi.h nasmlib.h
67 listing.o
: listing.c nasm.h version.h insnsi.h nasmlib.h listing.h
68 nasm.o
: nasm.c nasm.h version.h insnsi.h nasmlib.h preproc.h parser.h assemble.h labels.h \
69 outform.h listing.h insns.h
70 nasmlib.o
: nasmlib.c nasm.h version.h insnsi.h nasmlib.h names.c insnsn.c
71 ndisasm.o
: ndisasm.c nasm.h version.h insnsi.h nasmlib.h sync.h disasm.h
72 output
/outaout.o
: output
/outaout.c nasm.h version.h insnsi.h nasmlib.h outform.h
73 output
/outas86.o
: output
/outas86.c nasm.h version.h insnsi.h nasmlib.h outform.h
74 output
/outbin.o
: output
/outbin.c nasm.h version.h insnsi.h nasmlib.h outform.h
75 output
/outcoff.o
: output
/outcoff.c nasm.h version.h insnsi.h nasmlib.h outform.h
76 output
/outdbg.o
: output
/outdbg.c nasm.h version.h insnsi.h nasmlib.h outform.h
77 output
/outelf.o
: output
/outelf.c nasm.h version.h insnsi.h nasmlib.h outform.h
78 outform.o
: outform.c outform.h nasm.h version.h insnsi.h
79 output
/outobj.o
: output
/outobj.c nasm.h version.h insnsi.h nasmlib.h outform.h
80 output
/outrdf2.o
: output
/outrdf2.c nasm.h version.h insnsi.h nasmlib.h outform.h
81 output
/outieee.o
: output
/outieee.c nasm.h version.h insnsi.h nasmlib.h outform.h
82 parser.o
: parser.c nasm.h version.h insnsi.h nasmlib.h parser.h float.h names.c insnsn.c
83 preproc.o
: preproc.c nasm.h version.h insnsi.h nasmlib.h macros.c
86 # These source files are automagically generated from a single
87 # instruction-table file by a Perl script. They're distributed,
88 # though, so it isn't necessary to have Perl just to recompile NASM
89 # from the distribution.
91 insnsa.c
: insns.dat insns.pl
92 perl
$(srcdir)/insns.pl
-a
$(srcdir)/insns.dat
93 insnsd.c
: insns.dat insns.pl
94 perl
$(srcdir)/insns.pl
-d
$(srcdir)/insns.dat
95 insnsi.h
: insns.dat insns.pl
96 perl
$(srcdir)/insns.pl
-i
$(srcdir)/insns.dat
97 insnsn.c
: insns.dat insns.pl
98 perl
$(srcdir)/insns.pl
-n
$(srcdir)/insns.dat
100 # These files contains all the standard macros that are derived from
101 # the version number.
102 version.h
: version version.pl
103 perl
$(srcdir)/version.pl h
< $(srcdir)/version
> version.h
105 version.mac
: version version.pl
106 perl
$(srcdir)/version.pl mac
< $(srcdir)/version
> version.mac
108 # This source file is generated from the standard macros file
109 # `standard.mac' by another Perl script. Again, it's part of the
110 # standard distribution.
112 macros.c
: macros.pl standard.mac version.mac
113 perl
$(srcdir)/macros.pl
$(srcdir)/standard.mac version.mac
115 # This target generates all files that require perl.
116 # This allows easier generation of distribution (see dist target).
117 perlreq
: macros.c insnsa.c insnsd.c insnsi.h insnsn.c version.h version.mac
119 install: nasm ndisasm
120 $(INSTALL_PROGRAM
) nasm
$(INSTALLROOT
)$(bindir)/nasm
121 $(INSTALL_PROGRAM
) ndisasm
$(INSTALLROOT
)$(bindir)/ndisasm
122 $(INSTALL_DATA
) $(srcdir)/nasm
.1 $(INSTALLROOT
)$(mandir)/man1
/nasm
.1
123 $(INSTALL_DATA
) $(srcdir)/ndisasm
.1 $(INSTALLROOT
)$(mandir)/man1
/ndisasm
.1
126 rm -f
*.o
*.s
*.i nasm ndisasm
127 cd rdoff
&& $(MAKE
) clean
130 rm -f config.
* Makefile
*~
*.bak
*.lst
*.bin
131 cd rdoff
&& $(MAKE
) distclean
134 rm -f insnsa.c insnsd.c insnsi.h insnsn.c macros.c
*.man
136 cd doc
&& $(MAKE
) clean
138 spotless
: distclean cleaner
141 strip --strip-unneeded nasm ndisasm
146 rdf_install install_rdf
:
147 cd rdoff
&& $(MAKE
) install
150 cd doc
&& $(MAKE
) all
152 doc_install install_doc
:
153 cd doc
&& $(MAKE
) install
155 everything
: all doc rdf
157 install_everything
: everything
install install_doc install_rdf
159 dist: spotless perlreq
161 rm -rf .
/autom4te.cache
164 tar cvjf ..
/nasm-
`cat version`-`date +%Y%m%d`.
tar.bz2 ..
/`./nasm-dir`
166 nasm.spec
: nasm.spec.in version
167 sed
-e s
/@@VERSION@@
/`cat version`/g
< nasm.spec.in
> nasm.spec