]> git.tuebingen.mpg.de Git - tfortune.git/commitdiff
New make targets: exe, build-arch, man and build-indep.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 22 May 2019 13:56:31 +0000 (15:56 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 24 May 2019 06:33:09 +0000 (08:33 +0200)
It's good practice to provide separate make targets for generating
arch-dependent files (e.g., executables) and for arch-independent files
(e.g., manual pages). Currently there is only one file of either type
which gets installed by the make target, but this might change.

Makefile

index bc6a7a5480d35b277fc55b5f18d2373e74f78baa..66f0470dc7e2196984dec94236fa057ede3ec88f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -58,8 +58,11 @@ cc_version := $(shell $(CC) --version | head -n 1)
 build_date := $(shell date)
 uname_rs := $(shell uname -rs)
 
 build_date := $(shell date)
 uname_rs := $(shell uname -rs)
 
-all := tfortune tfortune.6.gz
-all: $(all)
+exe := tfortune
+man := tfortune.6.gz
+all: $(man) $(exe)
+man build-indep: $(man)
+exe build-arch: $(exe)
 
 deps := txp.bison.d txp.flex.d ast.d tfortune.d util.d txp.flex.d \
        tfortune.lsg.d version.d linhash.d
 
 deps := txp.bison.d txp.flex.d ast.d tfortune.d util.d txp.flex.d \
        tfortune.lsg.d version.d linhash.d
@@ -179,12 +182,12 @@ tfortune: $(deps:.d=.o)
        $(CC) $^ -o $@ $(TF_LDFLAGS) $(LDFLAGS)
 
 .PHONY: all mostlyclean clean distclan maintainer-clean install \
        $(CC) $^ -o $@ $(TF_LDFLAGS) $(LDFLAGS)
 
 .PHONY: all mostlyclean clean distclan maintainer-clean install \
-       install-strip README
+       install-strip README exe build-arch man build-indep
 
 mostlyclean:
 
 mostlyclean:
-       $(RM) tfortune *.o *.d
+       $(RM) $(exe) *.o *.d
 clean: mostlyclean
 clean: mostlyclean
-       $(RM) *.lsg.* *.flex.* *.bison.* *.6.gz *.suite
+       $(RM) *.lsg.* *.flex.* *.bison.* $(man) *.suite
 distclean: clean
        $(RM) config.mak config.status config.log config.h config.h.in \
                version.c configure.sh
 distclean: clean
        $(RM) config.mak config.status config.log config.h config.h.in \
                version.c configure.sh
@@ -202,8 +205,8 @@ endif
 
 install install-strip: all
        $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
 
 install install-strip: all
        $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
-       $(INSTALL_PROGRAM) $(strip_option) tfortune $(DESTDIR)$(bindir)
-       $(INSTALL_DATA) tfortune.6.gz $(DESTDIR)$(mandir)
+       $(INSTALL_PROGRAM) $(strip_option) $(exe) $(DESTDIR)$(bindir)
+       $(INSTALL_DATA) $(man) $(DESTDIR)$(mandir)
 
 define README :=
 tfortune - $(SLOGAN)
 
 define README :=
 tfortune - $(SLOGAN)
@@ -224,8 +227,8 @@ Resources
 
 Documentation
 ~~~~~~~~~~~~~
 
 Documentation
 ~~~~~~~~~~~~~
-See tfortune.suite. Or build the man page with \"make tfortune.6.gz\"
-and run \"man -l tfortune.6.gz\".
+See tfortune.suite. Or build the man page with \"make man\"
+and run \"man -l $(man)\".
 
 Dependencies
 ~~~~~~~~~~~~
 
 Dependencies
 ~~~~~~~~~~~~