summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/Makefile.each.tail/10-std.mk9
-rw-r--r--build-aux/Makefile.once.head/00-gnuconf.mk23
2 files changed, 25 insertions, 7 deletions
diff --git a/build-aux/Makefile.each.tail/10-std.mk b/build-aux/Makefile.each.tail/10-std.mk
index 5150a71..693f39d 100644
--- a/build-aux/Makefile.each.tail/10-std.mk
+++ b/build-aux/Makefile.each.tail/10-std.mk
@@ -12,6 +12,7 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
# Add some more defaults to the *_files variables
std.clean_files += $(std.gen_files) $(std.cfg_files) $(std.out_files)
@@ -38,7 +39,13 @@ _std.mostlyclean/$(outdir) := $(filter-out $(std.slow_files) $(std.cfg_file
_std.clean/$(outdir) := $(filter-out $(std.cfg_files) $(std.gen_files) $(std.src_files),$(std.clean_files))
_std.distclean/$(outdir) := $(filter-out $(std.gen_files) $(std.src_files),$(std.clean_files))
_std.maintainer-clean/$(outdir) := $(filter-out $(std.src_files),$(std.clean_files))
-$(addprefix $(outdir)/,uninstall mostlyclean clean distclean maintainer-clean): %: %-hook
+$(addprefix $(outdir)/,mostlyclean clean distclean maintainer-clean): %: %-hook
+ $(RM) -- $(sort $(filter-out %/,$(_std.$(@F)/$(@D))))
+ $(RM) -r -- $(sort $(filter %/,$(_std.$(@F)/$(@D))))
+ $(RMDIR_P) $(sort $(dir $(_std.$(@F)/$(@D)))) 2>/dev/null || $(TRUE)
+# separate uninstall to support GNU Coding Standards' NORMAL_UNINSTALL
+$(addprefix $(outdir)/,uninstall): %: %-hook
+ $(NORMAL_UNINSTALL)
$(RM) -- $(sort $(filter-out %/,$(_std.$(@F)/$(@D))))
$(RM) -r -- $(sort $(filter %/,$(_std.$(@F)/$(@D))))
$(RMDIR_P) $(sort $(dir $(_std.$(@F)/$(@D)))) 2>/dev/null || $(TRUE)
diff --git a/build-aux/Makefile.once.head/00-gnuconf.mk b/build-aux/Makefile.once.head/00-gnuconf.mk
index 79ecc34..83cb110 100644
--- a/build-aux/Makefile.once.head/00-gnuconf.mk
+++ b/build-aux/Makefile.once.head/00-gnuconf.mk
@@ -16,7 +16,7 @@
# This file is based on ยง7.2 "Makefile Conventions" of the release of
# the GNU Coding Standards dated April 13, 2016.
-gnuconf.pkgname ?= $(PACKAGE)
+gnuconf.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME))
ifeq ($(gnuconf.pkgname),)
$(error gnuconf.pkgname must be set)
endif
@@ -64,7 +64,7 @@ CCFLAGS ?= $(CFLAGS)
FLEX ?= flex
FLEXFLAGS ?=
INSTALL ?= install
-INSTALLFLAGS ?=
+#INSTALLFLAGS ?=
LD ?= ld
LDFLAGS ?=
LDCONFIG ?= ldconfig #TODO
@@ -92,14 +92,14 @@ CHMOD ?= chmod
CHOWN ?= chown
MKNOD ?= mknod
-# 7.2.3 Variables for Specifying Commands
-# ---------------------------------------
+# 7.2.3: Variables for Specifying Commands
+# ----------------------------------------
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= ${INSTALL} -m 644
-# 7.2.5 Variables for Installation Directories
-# --------------------------------------------
+# 7.2.5: Variables for Installation Directories
+# ---------------------------------------------
# Root for the installation
prefix ?= /usr/local
@@ -147,3 +147,14 @@ man5ext ?= .5
man6ext ?= .6
man7ext ?= .7
man8ext ?= .8
+
+# 7.2.7: Install Command Categories
+# ---------------------------------
+
+PRE_INSTALL ?=
+POST_INSTALL ?=
+NORMAL_INSTALL ?=
+
+PRE_UNINSTALL ?=
+POST_UNINSTALL ?=
+NORMAL_UNINSTALL ?=