chiark / gitweb /
Merge branch 'master' of https://git.distorted.org.uk/~markw/subdirmk
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Nov 2019 21:42:10 +0000 (21:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 13 Nov 2019 21:42:10 +0000 (21:42 +0000)
subdirmk/README
subdirmk/autogen.sh
subdirmk/generate
subdirmk/regen.mk.in
subdirmk/usual.mk.in

index 95cdd69024b8ea194ab2d32d10d31c5857bf3a85..1b249fd04b6f7914f7df0e63663b824eddc17bfa 100644 (file)
@@ -14,7 +14,7 @@ style is not very ergonomic.  The main difficulties are:
   - constantly having to write out long file and directory names
   - the lack of a per-directory make variable namespace means
     long make variables (or namespace clashes)
-  - it is difficult to arrange that one can cd to a subdirectory 
+  - it is difficult to arrange that one can cd to a subdirectory
     and say `make all' and have something reasonable happen
     (to wit, build an appropriate subset)
 
@@ -151,8 +151,8 @@ we describe the expansion at the top level, which is often a special
 case (in general in variable names we call that TOP rather than the
 empty string).
 
-&CAPS          =>      sub_dir_CAPS                    or TOP_CAPS
-&lc            =>      sub/dir/lc                      or lc
+&CAPS          =>      sub_dir_CAPS                    or TOP_CAPS
+&lc            =>      sub/dir/lc                      or lc
        Here CAPS is any ASCII letter A-Z and lc is a-z.
        The assumption is that filenames are usually lowercase and
        variables usually uppercase.  Otherwise, use another syntax:
index 4e361fc0e38f973dafd71fcc7e777175fe0365a4..e28e80e0ce9a781dec49b395b83690ee2eef4344 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/sh
 # subdirmk, autogen.sh (conventional autoconf invocation script)
-#  Copyright 2019 Mark Wooding
 #  Copyright 2019 Ian Jackson
 # SPDX-License-Identifier: LGPL-2.0-or-later
 set -e
index 8669864df0620a521eff9d5d615156de6fb4c9d6..8a5daa6b0fc6269cfc6c2cba935b957a0c62e8e2 100755 (executable)
@@ -102,8 +102,9 @@ default: all
 %:     FORCE-ALWAYS-RUN
        \@:
 Makefile FORCE-ALWAYS-RUN:
-       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(MAKECMDGOALS))
+       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(or \$(MAKECMDGOALS),all))
 .SUFFIXES:
+.PHONY:        FORCE-ALWAYS-RUN
 END
 }
 
@@ -251,7 +252,7 @@ sub process_subtree ($$) {
        }
        print O "\n";
     }
-    
+
     return @targets;
 }
 
index 65d75c2ebfc32db72ccb6e7e432ba4ee6b71cfda..bd56a24e677174d10a57d362d272ecc0158e1d84 100644 (file)
@@ -4,11 +4,11 @@
 # SPDX-License-Identifier: LGPL-2.0-or-later
 
 CONFIGURE      ?= configure
-CONFIGURE_AC   ?= $(CONFIGURE).ac
-CONFIG_STATUS  ?= config.status
+CONFIGURE_AC   ?= $(CONFIGURE).ac
+CONFIG_STATUS  ?= config.status
 
-CONFIGURE_ACS  += $(CONFIGURE_AC)
-CONFIGURE_ACS  += subdirmk/subdirmk.ac
+CONFIGURE_ACS  += $(CONFIGURE_AC)
+CONFIGURE_ACS  += subdirmk/subdirmk.ac
 
 $(top_srcdir)/$(CONFIGURE): $(addprefix $(top_srcdir)/,$(CONFIGURE_ACS))
        cd $(top_srcdir) && autoconf
@@ -22,7 +22,7 @@ MAKEFILE_TEMPLATES += $(addprefix $(top_srcdir)/, $(addsuffix .in, \
        ))
 
 main.mk $(MAKEFILES): .makefiles.stamp ;
-.makefiles.stamp:                                              \
+.makefiles.stamp:                                              \
                $(top_srcdir)/subdirmk/generate                 \
                $(CONFIG_STATUS)                                \
                $(MAKEFILE_TEMPLATES)
@@ -38,9 +38,9 @@ main.mk $(MAKEFILES): .makefiles.stamp ;
                $(filter-out Subdir.sd.mk %/Subdir.sd.mk        \
                             %.mk.in                            \
                        , $?),,                                 \
-               $(sort                                          \
+               $(patsubst $(top_srcdir)/%,%, $(sort            \
                        $(patsubst %.sd.mk,%.mk,$(filter %.sd.mk,$?)) \
-                       $(patsubst %.mk.in,%.mk,$(filter %.mk.in,$?))))
+                       $(patsubst %.mk.in,%.mk,$(filter %.mk.in,$?)))))
        touch $@
 
 realclean:: clean
index 00c48fe1ef2d0a81905dce6b0e5f11fd82f13f8a..97f99e71bd676abb016dc1c3f78b015729f5240d 100644 (file)
@@ -3,7 +3,7 @@
 #  Copyright 2019 Ian Jackson
 # SPDX-License-Identifier: LGPL-2.0-or-later
 
-VPATH          = &^
+VPATH          = $(top_srcdir)
 
 prefix         = @prefix@
 exec_prefix    = @exec_prefix@