From 4eac60b2aeaba0ff660fd9f58fcdce210592bac0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 10 Nov 2019 12:43:18 +0000 Subject: [PATCH] WIP NEW STYLE --- NOTES | 24 ++++++++++++++++++++++++ lib/Subdir.mk.in | 16 +++++----------- lib/t/Subdir.mk.in | 17 +++++++---------- src/Subdir.mk.in | 13 +++++-------- 4 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 NOTES diff --git a/NOTES b/NOTES new file mode 100644 index 0000000..b202381 --- /dev/null +++ b/NOTES @@ -0,0 +1,24 @@ +&= => subdir +&_ => subdir_ +&/ => subdir/ +&CAPS => subdir_CAPS +&lc => subdir/lc + +&.= &._ &./ &.CAPS &.lc => $(top_srcdir)/subdir +&:= &:_ &:/ &:CAPS &:lc => $(abs_top_srcdir)/subdir +& thing thing => like &thing &thing (until EOL) + +&& => & + +&! spc disables & *until* EOL + +&!STUFF STUFF is recognised instead of & (beyond EOL) + STUFF is either all punct or all alphanum (incl _) + any lwsp after STUFF is discarded too +eg notably + STUFF!& now & is recognised instead (ie back to normal) + STUFFSTUFF STUFF + +eg + &!@@@ @@@ is recognised instead of & + @@@!& go back to & diff --git a/lib/Subdir.mk.in b/lib/Subdir.mk.in index eba1ce1..8dd75e1 100644 --- a/lib/Subdir.mk.in +++ b/lib/Subdir.mk.in @@ -3,6 +3,7 @@ ### Build script for library ### ### (c) 2019 Mark Wooding +### (c) 2019 Ian Jackson ### ###----- Licensing notice --------------------------------------------------- @@ -22,16 +23,9 @@ ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ### MA 02111-1307, USA. -$D/all:: $D/libtoy.a -$D_CLEANFILES := +&TARGETS_all += & libtoy.a -libtoy_SOURCES := $(addprefix $D/, toylib.c) -libtoy_OBJECTS := $(call objects, $(libtoy_SOURCES)) -$(call notice-objects, $(libtoy_OBJECTS)) +&OBJECTS += & toylib.c -$D/libtoy.a: $(libtoy_OBJECTS) - $(call v-tag,AR)ar rc $@ $^ -$D_CLEANFILES += $D/libtoy.a - -SUBDIRS = t -$(call descend-subdirs, $(SUBDIRS)) +&libtoy.a: $(&OBJECTS) + $(AR) rc $@ $^ diff --git a/lib/t/Subdir.mk.in b/lib/t/Subdir.mk.in index a35f479..a5efee5 100644 --- a/lib/t/Subdir.mk.in +++ b/lib/t/Subdir.mk.in @@ -3,6 +3,7 @@ ### Build script for library test ### ### (c) 2019 Mark Wooding +### (c) 2019 Ian Jackson ### ###----- Licensing notice --------------------------------------------------- @@ -22,20 +23,16 @@ ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ### MA 02111-1307, USA. -$D_CLEANFILES := +&TARGETS_check += & toytest.stamp -$D/check:: $D/toytest.stamp +&OBJECTS += & toytest.o +&LIBS += lib/libtoy.a -toytest_SOURCES := $(addprefix $D/, toytest.c) -toytest_OBJECTS := $(call objects, $(toytest_SOURCES)) -toytest_LIBS = lib/libtoy.a -$(call notice-objects, $(toytest_OBJECTS)) +&CLEAN += & toytest -$D/toytest: $(toytest_OBJECTS) $(toytest_LIBS) +&toytest: $(&OBJECTS) $(&LIBS) $(LINK) $^ -$D_CLEANFILES += $D/toytest -$D/toytest.stamp: $D/toytest +&toytest.stamp: & toytest $< touch $@ -$D_CLEANFILES += $D/toytest.stamp diff --git a/src/Subdir.mk.in b/src/Subdir.mk.in index 8c9acd4..462bd37 100644 --- a/src/Subdir.mk.in +++ b/src/Subdir.mk.in @@ -3,6 +3,7 @@ ### Build script for main program ### ### (c) 2019 Mark Wooding +### (c) 2019 Ian Jackson ### ###----- Licensing notice --------------------------------------------------- @@ -22,14 +23,10 @@ ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ### MA 02111-1307, USA. -$D/all:: $D/toy -$D_CLEANFILES := +&TARGETS_all += & toy -toy_SOURCES := $(addprefix $D/, toy.c) -toy_OBJECTS := $(call objects, $(toy_SOURCES)) -toy_LIBS = lib/libtoy.a -$(call notice-objects, $(toy_OBJECTS)) +&OBJECTS += & toy.o +&LIBS += lib/libtoy.a -$D/toy: $(toy_OBJECTS) $(toy_LIBS) +&toy: $(&OBJECTS) $(&LIBS) $(LINK) $^ -$D_CLEANFILES += $D/toy -- 2.30.2