chiark / gitweb /
Switch to using subdirmk for the top-level
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 14 Nov 2019 00:04:19 +0000 (00:04 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 14 Nov 2019 00:24:02 +0000 (00:24 +0000)
We have incorporated the subdirectories yet...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
Subdir.sd.mk
config.h.in
configure
configure.ac

index 1b9c248af15516e01d61f58daccbfa92f1428252..5a1032c1d72c110ba6635cf9f6a097a3d4a0dfc9 100644 (file)
@@ -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
index 0423cf44ebf5a87a13b618664c544f4e2bafa291..d7af1d35fdc742f4c7ad238d54421a12b6cf5993 100644 (file)
@@ -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:
 #
index 4df92ecd983cf4f610c8478992e17302c04c749c..a59a02c572fa885e6ed6cee92083c0d88351b0ee 100644 (file)
@@ -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
index 0d4aeabefcd0c36a6fc787f7510cd349195e3ed9..33300d1623a8500a9a65b624448649023245a44b 100755 (executable)
--- 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" ;;
index da8b1d72fa9950c21e89429ca5922051eb17d6c2..e5abd68f020fad3a8f54c622c43f4b3bd7a43005 100644 (file)
@@ -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)