From: Andre Noll Date: Wed, 19 Apr 2017 17:13:20 +0000 (+0200) Subject: Merge branch 'refs/heads/t/makefile_conventions' X-Git-Tag: v0.6.0~9 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=40b1bbc50682effec5cf18b0923cfab24e154245;hp=4d067435b1167dbf5217c875ac9fd7ac69ad91bd Merge branch 'refs/heads/t/makefile_conventions' A bunch of changes which strive to make the paraslash build system more standard. Cooking for three months. * refs/heads/t/makefile_conventions: build: Add target "check" as a synonym for "test". build: Rename target "tarball" to "dist". build: Do not strip installed executables by default. build: Support $(DESTDIR). build: Rename clean targets. --- diff --git a/INSTALL b/INSTALL index 85b4fab1..547036b1 100644 --- a/INSTALL +++ b/INSTALL @@ -16,10 +16,8 @@ Installing paraslash from git Example for cross-compiling ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - export CROSS_COMPILE='armv6j-hardfloat-linux-gnueabi-' + export CC='armv6j-hardfloat-linux-gnueabi-gcc' export PATH="/usr/cross/arm/bin:$PATH" - export CC=${CROSS_COMPILE}gcc - export LDFLAGS=' -L/usr/sysroot/arm/lib -L/usr/sysroot/arm/usr/lib @@ -29,7 +27,7 @@ Example for cross-compiling autoconf autoheader ./configure --host=arm-linux-gnueabi --prefix /usr/sysroot/arm/usr/local - make CROSS_COMPILE=$CROSS_COMPILE + make For details see the user manual: diff --git a/Makefile.in b/Makefile.in index 3c51029b..6e84b6fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,7 +8,6 @@ datarootdir := @datarootdir@ PACKAGE_TARNAME := @PACKAGE_TARNAME@ PACKAGE_VERSION := @PACKAGE_VERSION@ -INSTALL := @INSTALL@ M4 := @M4@ GENGETOPT := @GENGETOPT@ HELP2MAN := @HELP2MAN@ diff --git a/Makefile.real b/Makefile.real index 8a8cd434..5e4dbe68 100644 --- a/Makefile.real +++ b/Makefile.real @@ -9,7 +9,6 @@ endif vardir := /var/paraslash mandir := $(datarootdir)/man/man1 -STRIP := $(CROSS_COMPILE)strip MKDIR_P := mkdir -p prefixed_executables := $(addprefix para_, $(executables)) @@ -63,10 +62,11 @@ tarball_pfx := $(PACKAGE_TARNAME)-$(GIT_VERSION) tarball_delete := $(addprefix $(tarball_pfx)/, web .gitignore) tarball := $(tarball_pfx).tar.bz2 -.PHONY: all clean clean2 distclean maintainer-clean install man tarball all: $(prefixed_executables) $(man_pages) +.PHONY: all mostlyclean clean distclean maintainer-clean install \ + install-strip man dist tarball + man: $(man_pages) -tarball: $(tarball) include $(m4_ggo_dir)/makefile include $(test_dir)/makefile.test @@ -335,31 +335,36 @@ $(prefixed_executables): @[ -z "$(Q)" ] || echo 'LD $@' $(Q) $(CC) $^ -o $@ $(LDFLAGS) -clean: - @[ -z "$(Q)" ] || echo 'CLEAN' +mostlyclean: + @[ -z "$(Q)" ] || echo 'MOSTLYCLEAN' $(Q) rm -f para_* $(Q) rm -rf $(object_dir) - -clean2: clean - @[ -z "$(Q)" ] || echo 'CLEAN2' +clean: mostlyclean + @[ -z "$(Q)" ] || echo 'CLEAN' $(Q) rm -rf $(build_dir) -distclean: clean2 test-clean +distclean: clean @[ -z "$(Q)" ] || echo 'DISTCLEAN' $(Q) rm -f Makefile autoscan.log config.status config.log - $(Q) rm -f GPATH GRTAGS GSYMS GTAGS - + $(Q) rm -f config.h configure config.h.in maintainer-clean: distclean @[ -z "$(Q)" ] || echo 'MAINTAINER-CLEAN' - $(Q) rm -f *.tar.bz2 config.h configure config.h.in + $(Q) rm -f *.tar.bz2 + $(Q) rm -f GPATH GRTAGS GSYMS GTAGS + +INSTALL ?= install +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= $(INSTALL) -m 644 +ifneq ($(findstring strip, $(MAKECMDGOALS)),) + strip_option := -s +endif -install: all man - $(MKDIR_P) $(bindir) $(mandir) - $(INSTALL) -s --strip-program $(STRIP) -m 755 \ - $(prefixed_executables) $(bindir) - $(INSTALL) -m 644 $(man_pages) $(mandir) - $(MKDIR_P) $(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain +install install-strip: all man + $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) + $(INSTALL) $(strip_option) $(prefixed_executables) $(DESTDIR)$(bindir) + $(INSTALL_DATA) $(man_pages) $(DESTDIR)$(mandir) + $(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain -$(tarball): +$(tarball) dist tarball: $(Q) rm -rf $(tarball) $(tarball_pfx) $(Q) git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \ | tar --delete $(tarball_delete) > $(tarball_pfx).tar diff --git a/NEWS.md b/NEWS.md index 6184335e..ae0c14b5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,14 @@ NEWS by aes_ctr128 three years ago but the RC4 code had been kept for backwards compatibility. - On Linux, abstract unix domain sockets are used unconditionally. +- The "install" target no longer strips executables, the new + install-strip target can be used to get the old behaviour. +- The clean targets have been renamed: clean2 is gone, and the new + mostlyclean removes only the executables and object files. +- New target: check (identical to test). +- The DESTDIR make variable is honored to prepend a path to the + installation directory. This feature is orthogonal to the --prefix + option to configure. Downloads: [tarball](./releases/paraslash-git.tar.bz2), diff --git a/autogen.sh b/autogen.sh index d432adbb..708602e7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -24,5 +24,5 @@ autoheader echo configuring... ./configure $@ > /dev/null echo compiling... -make clean2 > /dev/null 2>&1 +make clean > /dev/null 2>&1 make -j $n > /dev/null diff --git a/configure.ac b/configure.ac index afed0a79..eed441d6 100644 --- a/configure.ac +++ b/configure.ac @@ -63,10 +63,6 @@ AC_PATH_PROG([HELP2MAN], [help2man]) test -z "$HELP2MAN" && AC_MSG_ERROR( [help2man is required to build this package]) -AC_PATH_PROG([INSTALL], [install]) -test -z "$INSTALL" && AC_MSG_ERROR( - [The install program is required to build this package]) - AC_PROG_CC AC_PROG_CPP diff --git a/t/makefile.test b/t/makefile.test index 15bb6859..a71963c9 100644 --- a/t/makefile.test +++ b/t/makefile.test @@ -18,6 +18,7 @@ endif tests := $(sort $(wildcard $(test_dir)/t[0-9][0-9][0-9][0-9]-*.sh)) +check: $(tests) test: $(tests) $(tests): all @@ -30,4 +31,4 @@ test-clean: $(RM) -r $(results_dir) $(RM) -r $(trash_dir) -.PHONY: $(tests) test-help +.PHONY: $(tests) test-help test-clean test check