From 10bc1cd20004adf302065dc6dc5c9f40270f70a3 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 18 Jan 2020 12:49:25 +0000 Subject: project: added logic for generating bin/aclocal-x.y.z and bin/automake-x.y.z. --- project/srcgen.mk | 29 ++++++++++++++++++++++++++++- project/tree.mk | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/project/srcgen.mk b/project/srcgen.mk index ef689ce..26e8760 100644 --- a/project/srcgen.mk +++ b/project/srcgen.mk @@ -1,6 +1,10 @@ # srcgen.mk: rules for source-file generation. # this file is covered by COPYING.BAUTOMAKE. +AM_AUTOM4TE = autom4te +AM_AUTOCONF = autoconf +AM_SHELL = /bin/sh + M4_GEN_SRCS = m4/amversion.m4 M4_CONFIGURE_INPUT = Generated via variable substitution from $(subst $(SOURCE_DIR)/m4/,,$<). @@ -9,11 +13,34 @@ M4_SUBST_RULES = \ -e 's!@VERSION@!$(AUTOMAKE_VER)!g' \ -e 's!@APIVERSION@!$(AUTOMAKE_VER)!g' -ALL_GEN_SRCS = $(M4_GEN_SRCS) +BIN_GEN_SRCS = bin/aclocal-$(AUTOMAKE_VER) bin/automake-$(AUTOMAKE_VER) +BIN_CONFIGURE_INPUT = Generated via variable substitution from $(subst $(SOURCE_DIR)/bin/,,$<). + +BIN_SUBST_RULES = \ + -e 's!@configure_input@!$(BIN_CONFIGURE_INPUT)!g' \ + -e 's!@PACKAGE@!$(PACKAGE)!g' \ + -e 's!@VERSION@!$(AUTOMAKE_VER)!g' \ + -e 's!@APIVERSION@!$(AUTOMAKE_VER)!g' \ + -e 's!@RELEASE_YEAR@!$(AUTOMAKE_YEAR)!g' \ + -e 's!@PACKAGE_BUGREPORT@!$(PKGBUGS)!g' \ + -e 's!@PACKAGE_URL@!$(PKGHOME)!g' \ + -e 's!@PERL@!$(HOST_PERL)!g' \ + -e 's!@SHELL@!$(AM_SHELL)!g' \ + -e 's!@am_AUTOCONF@!$(AM_AUTOCONF)!g' \ + -e 's!@am_AUTOM4TE@!$(AM_AUTOM4TE)!g' \ + -e 's!@datadir@!$(DATADIR)!g' + +ALL_GEN_SRCS = $(M4_GEN_SRCS) $(BIN_GEN_SRCS) m4/amversion.m4: $(SOURCE_DIR)/m4/amversion.in tree.tag sed $(M4_SUBST_RULES) $< > $@ +bin/aclocal-$(AUTOMAKE_VER): $(SOURCE_DIR)/bin/aclocal.in tree.tag + sed $(BIN_SUBST_RULES) $< > $@ && chmod +x $@ + +bin/automake-$(AUTOMAKE_VER): $(SOURCE_DIR)/bin/automake.in tree.tag + sed $(BIN_SUBST_RULES) $< > $@ && chmod +x $@ + srcgen: $(ALL_GEN_SRCS) srcgen-clean: diff --git a/project/tree.mk b/project/tree.mk index b7a5ff8..5785ef7 100644 --- a/project/tree.mk +++ b/project/tree.mk @@ -1,4 +1,4 @@ -TREE_DIRS = m4 +TREE_DIRS = m4 bin tree.tag: mkdir -p $(TREE_DIRS) -- cgit v1.2.3