From 7ff66e19d76edc0e84e4349c41a5b34d062b490a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 14 Nov 2019 00:04:19 +0000 Subject: [PATCH] Switch to using subdirmk for the top-level We have incorporated the subdirectories yet... Signed-off-by: Ian Jackson --- .gitignore | 5 +++++ Subdir.sd.mk | 27 ++++++++------------------- config.h.in | 2 +- configure | 36 ++++++++++++++++++++++++++++++++---- configure.ac | 6 +++++- 5 files changed, 51 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 1b9c248..5a1032c 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,13 @@ msgcode-test.confirm autom4te.cache *~ +*.tmp TAGS +.makefiles.stamp +Subdir.mk +/main.mk + debian/files debian/secnet.debhelper.log debian/*.debhelper diff --git a/Subdir.sd.mk b/Subdir.sd.mk index 0423cf4..d7af1d3 100644 --- a/Subdir.sd.mk +++ b/Subdir.sd.mk @@ -82,28 +82,17 @@ STALE_PYTHON_FILES= $(foreach e, py pyc, \ %.o: %.c conffile.yy.h $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@ -all: $(TARGETS) check +all:: $(TARGETS) check -# Automatic remaking of configuration files, from autoconf documentation -${srcdir}/configure: configure.in - cd ${srcdir} && autoconf +include subdirmk/regen.mk # autoheader might not change config.h.in, so touch a stamp file. ${srcdir}/config.h.in: config.stamp.in -${srcdir}/config.stamp.in: configure.in +${srcdir}/config.stamp.in: configure.ac cd ${srcdir} && autoheader echo timestamp > ${srcdir}/config.stamp.in -config.h: config.stamp -config.stamp: config.h.in config.status - ./config.status - -Makefile: Makefile.in config.status - ./config.status - -config.status: configure - ./config.status --recheck -# End of config file remaking rules +MAKEFILE_TEMPLATES += config.h.in # C and header file dependency rules SOURCES:=$(OBJECTS:.o=.c) $(TEST_OBJECTS:.o=.c) @@ -197,7 +186,7 @@ installdirs: install: installdirs set -e; ok=true; for f in $(STALE_PYTHON_FILES); do \ if test -e $$f; then \ - echo >&2 "ERROR: $$f still exists "\ + echo >\&2 "ERROR: $$f still exists "\ "- try \`make install-force'"; \ ok=false; \ fi; \ @@ -216,7 +205,7 @@ install-force: rm -f $(STALE_PYTHON_FILES) $(MAKE) install -clean: $(addprefix clean-,$(TESTDIRS)) +clean:: $(addprefix clean-,$(TESTDIRS)) $(RM) -f *.o *.yy.[ch] *.tab.[ch] $(TARGETS) core version.c $(RM) -f *.d *.pyc *~ eax-*-test.confirm eax-*-test $(RM) -rf __pycache__ @@ -225,12 +214,12 @@ clean: $(addprefix clean-,$(TESTDIRS)) $(addprefix clean-,$(TESTDIRS)): clean-%: $(MAKE) -C $* clean -realclean: clean +realclean:: clean $(RM) -f *~ Makefile config.h *.d \ config.log config.status config.cache \ config.stamp Makefile.bak -distclean: realclean +distclean:: realclean # Release checklist: # diff --git a/config.h.in b/config.h.in index 4df92ec..a59a02c 100644 --- a/config.h.in +++ b/config.h.in @@ -1,4 +1,4 @@ -/* config.h.in. Generated from configure.in by autoheader. */ +/* config.h.in. Generated from configure.ac by autoheader. */ #ifndef _CONFIG_H diff --git a/configure b/configure index 0d4aeab..33300d1 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in. +# From configure.ac Id: configure.in. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for secnet 0.1.18+. # @@ -680,7 +680,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +_SUBDIRMK_MAKEFILES' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -2344,6 +2345,23 @@ ac_config_headers="$ac_config_headers config.h" + ac_config_files="$ac_config_files main.mk:main.mk.tmp Subdir.mk:Subdir.mk.tmp" + + + + _SUBDIRMK_MAKEFILES="$_SUBDIRMK_MAKEFILES subdirmk/regen.mk" + ac_config_files="$ac_config_files subdirmk/regen.mk:subdirmk/regen.mk.in" + + + _SUBDIRMK_MAKEFILES="$_SUBDIRMK_MAKEFILES subdirmk/usual.mk" + ac_config_files="$ac_config_files subdirmk/usual.mk:subdirmk/usual.mk.in" + + + + + + + ac_ext=c @@ -4735,7 +4753,7 @@ else $as_echo "$as_me: WARNING: Disabling IPv6 support" >&2;} fi -ac_config_files="$ac_config_files Makefile common.make test-common.make test-example/Makefile stest/Makefile mtest/Makefile" +ac_config_files="$ac_config_files common.make test-common.make test-example/Makefile stest/Makefile mtest/Makefile" ac_config_commands="$ac_config_commands default" @@ -5426,6 +5444,13 @@ _ASBOX _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# + + '$srcdir'/subdirmk/generate --srcdir='$srcdir' $subdirmk_subdirs + + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -5435,7 +5460,10 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "main.mk") CONFIG_FILES="$CONFIG_FILES main.mk:main.mk.tmp" ;; + "Subdir.mk") CONFIG_FILES="$CONFIG_FILES Subdir.mk:Subdir.mk.tmp" ;; + "subdirmk/regen.mk") CONFIG_FILES="$CONFIG_FILES subdirmk/regen.mk:subdirmk/regen.mk.in" ;; + "subdirmk/usual.mk") CONFIG_FILES="$CONFIG_FILES subdirmk/usual.mk:subdirmk/usual.mk.in" ;; "common.make") CONFIG_FILES="$CONFIG_FILES common.make" ;; "test-common.make") CONFIG_FILES="$CONFIG_FILES test-common.make" ;; "test-example/Makefile") CONFIG_FILES="$CONFIG_FILES test-example/Makefile" ;; diff --git a/configure.ac b/configure.ac index da8b1d7..e5abd68 100644 --- a/configure.ac +++ b/configure.ac @@ -19,10 +19,14 @@ dnl https://www.gnu.org/licenses/gpl.html. sinclude(ac_prog_cc_no_writeable_strings.m4) +m4_include(subdirmk/subdirmk.ac) + AC_INIT(secnet,0.1.18+,secnet@chiark.greenend.org.uk) AC_CONFIG_SRCDIR(secnet.c) AC_CONFIG_HEADER(config.h) +SUBDIRMK_SUBDIRS([]) + AC_PREREQ(2.50) AC_REVISION($Id: configure.in,v 1.4 2002/09/09 22:05:02 steve Exp $) @@ -96,7 +100,7 @@ else AC_MSG_WARN([Disabling IPv6 support]) fi -AC_OUTPUT(Makefile common.make test-common.make +AC_OUTPUT(common.make test-common.make test-example/Makefile stest/Makefile mtest/Makefile, echo timestamp >config.stamp) -- 2.30.2