aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.in
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-05-26 14:13:31 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-05-26 14:13:31 -0700
commit941c75a2b2b674e88bff25ad8f6333097306dcb0 (patch)
tree11468fa515d68f4b66d19a63f43f7e1d6d08b274 /Makefile.in
parentac30bd6a5fd352508f95a253e007fe39131ad8fb (diff)
downloadnasm-941c75a2b2b674e88bff25ad8f6333097306dcb0.tar.gz
nasm-941c75a2b2b674e88bff25ad8f6333097306dcb0.tar.xz
nasm-941c75a2b2b674e88bff25ad8f6333097306dcb0.zip
Makefile portability improvement, build nasmdoc.pdf.xz
Significantly improve the portability/reliability of a general make command. Build a .pdf.xz version of the documentation, using an uncompressed pdf as basis. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in55
1 files changed, 39 insertions, 16 deletions
diff --git a/Makefile.in b/Makefile.in
index 68ec9d45..7cc210e2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -47,13 +47,18 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+# Optional tools
NROFF = @NROFF@
ASCIIDOC = @ASCIIDOC@
XMLTO = @XMLTO@
+MAKENSIS = @MAKENSIS@
+XZ = @XZ@
-MAKENSIS = makensis
+# Optional targets
+MANPAGES = @MANPAGES@
+NSIS = @NSIS@
-MKDIR = mkdir -p
+MKDIR_P = @MKDIR_P@
RM_F = rm -f
RM_RF = rm -rf
LN_S = @LN_S@
@@ -74,7 +79,7 @@ endif
.PHONY: all doc rdf install clean distclean cleaner spotless install_rdf test
.PHONY: install_doc everything install_everything strip perlreq dist tags TAGS
-.PHONY: manpages nsis
+.PHONY: nothing manpages nsis
.c.$(O):
$(CC) -c $(ALL_CFLAGS) -o $@ $<
@@ -147,10 +152,14 @@ XSUBDIRS = test doc nsis rdoff
DEPDIRS = . include config x86 rdoff $(SUBDIRS)
#-- End File Lists --#
-all: nasm$(X) ndisasm$(X) rdf
+all: dirs
+ $(MAKE) nasm$(X) ndisasm$(X) rdf
NASMLIB = libnasm.$(A)
+dirs:
+ $(MKDIR_P) $(SUBDIRS) $(XSUBDIRS)
+
$(NASMLIB): $(LIBOBJ)
$(RM_F) $(NASMLIB)
$(AR) cq $(NASMLIB) $(LIBOBJ)
@@ -249,7 +258,7 @@ x86/regs.h: x86/regs.dat x86/regs.pl
WARNFILES = asm/warnings.c include/warnings.h doc/warnings.src
warnings:
- rm -f $(WARNFILES)
+ $(RM_F) $(WARNFILES)
$(MAKE) $(WARNFILES)
asm/warnings.c: asm/warnings.pl
@@ -348,8 +357,6 @@ $(RDFLIB): $(RDFLIBOBJ)
#-- Begin NSIS Rules --#
-# NSIS is not built except by explicit request, as it only applies to
-# Windows platforms
nsis/arch.nsh: nsis/getpearch.pl nasm$(X)
$(PERL) $(srcdir)/nsis/getpearch.pl nasm$(X) > nsis/arch.nsh
@@ -365,10 +372,10 @@ nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh
manpages: nasm.1 ndisasm.1
install: nasm$(X) ndisasm$(X)
- $(MKDIR) $(DESTDIR)$(bindir)
+ $(MKDIR_P) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) nasm$(X) $(DESTDIR)$(bindir)/nasm$(X)
$(INSTALL_PROGRAM) ndisasm$(X) $(DESTDIR)$(bindir)/ndisasm$(X)
- $(MKDIR) $(DESTDIR)$(mandir)/man1
+ $(MKDIR_P) $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) $(srcdir)/nasm.1 $(DESTDIR)$(mandir)/man1/nasm.1
$(INSTALL_DATA) $(srcdir)/ndisasm.1 $(DESTDIR)$(mandir)/man1/ndisasm.1
@@ -417,7 +424,7 @@ cscope:
cscope -b -f cscope.out
rdf_install install_rdf install_rdoff:
- $(MKDIR) $(DESTDIR)$(bindir)
+ $(MKDIR_P) $(DESTDIR)$(bindir)
for f in $(RDFPROGS); do \
$(INSTALL_PROGRAM) "$$f" '$(DESTDIR)$(bindir)'/ ; \
done
@@ -426,7 +433,7 @@ rdf_install install_rdf install_rdoff:
bn=`basename "$$f"` && $(RM_F) "$$bn" && \
$(LN_S) rdf2bin$(X) "$$bn" ; \
done
- $(MKDIR) $(DESTDIR)$(mandir)/man1
+ $(MKDIR_P) $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) $(srcdir)/rdoff/*.1 $(DESTDIR)$(mandir)/man1/
doc: doc/warnings.src
@@ -435,19 +442,27 @@ doc: doc/warnings.src
doc_install install_doc:
$(MAKE) -C doc install
-everything: all manpages doc rdf
+# Dummy target to prevent accidental invocation of the default "all" target
+nothing:
+
+always_everything: all doc rdf
+
+everything: always_everything
+ $(MAKE) $(MANPAGES) $(NSIS) nothing
install_everything: everything install install_doc install_rdf
dist:
$(MAKE) alldeps
- $(MAKE) spotless perlreq manpages spec
+ $(MAKE) spotless perlreq manpages spec $(MANPAGES)
autoheader
autoconf
$(RM_RF) ./autom4te*.cache
tar: dist
- tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
+ tar -cv --exclude CVS -C .. -f - | \
+ $(XZ) -9e > \
+ ../nasm-`cat version`-`date +%Y%m%d`.tar.xz `basename \`pwd\``
spec: nasm.spec
@@ -456,11 +471,11 @@ ALLPERLSRC := $(shell find $(srcdir) -type f -name '*.p[lh]')
perlbreq.si: $(ALLPERLSRC)
sed -n -r -e 's/^[[:space:]]*use[[:space:]]+([^[:space:];]+).*$$/BuildRequires: perl(\1)/p' $(ALLPERLSRC) | \
sed -r -e '/perl\((strict|warnings|Win32.*)\)/d' | \
- sort | uniq > perlbreq.si || ( rm -f perlbreq.si ; false )
+ sort | uniq > perlbreq.si
nasm.spec: nasm.spec.in nasm.spec.sed version.sed perlbreq.si
sed -f version.sed -f nasm.spec.sed \
- < nasm.spec.in > nasm.spec || ( rm -f nasm.spec ; false )
+ < nasm.spec.in > nasm.spec
splint:
splint -weak *.c
@@ -495,6 +510,14 @@ doc/Makefile: Makefile
config/config.h: config.status
#
+# Dummy rules that changes make behavior
+# (at end to avoid confusing non-GNU makes)
+#
+.SECONDARY:
+
+.DELETE_ON_ERROR:
+
+#
# Does this version of this file have external dependencies? This definition
# will be automatically updated by mkdep.pl as needed.
#