chiark / gitweb /
test-example: all-privkeys: Define, and indirect through, a variable
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 4 Dec 2019 21:58:54 +0000 (21:58 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 21:52:07 +0000 (21:52 +0000)
This seems more natural.  Also it provides a variable
$(test-example_PRIVKEYS) which can be used elsewhere.  (We are in fact
going to want that.)

One resulting change is that now the keys in *.privkeys/ are part of
&TARGETS too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
test-example/Subdir.sd.mk

index 41aaec5c20efc4bb6c3e9b4ccdb2ba85660913d1..c8f837945c92de8d76fe170aa3e78a2aacf1bf8f 100644 (file)
@@ -1,5 +1,4 @@
 &TARGETS += & sites.conf sites-nonego.conf
-&TARGETS += & inside.key outside.key rsa1-sites2.key all-privkeys
 
 include common.make
 
@@ -20,7 +19,7 @@ include common.make
 define privkey
 &/$1.privkeys/priv.$2: &/$3
        mkdir -p $$(dir $$@) && cp $$< $$@.tmp && mv -f $$@.tmp $$@
-&all-privkeys:: &/$1.privkeys/priv.$2
+&PRIVKEYS += &/$3 &/$1.privkeys/priv.$2
 &clean::
        rm -rf &/$1.privkeys
 endef
@@ -29,4 +28,7 @@ $(eval $(call privkey,outside,5dc36a4700,rsa1-sites2.key))
 $(eval $(call privkey,outside,0000000000,outside.key))
 $(eval $(call privkey,inside,0000000000,inside.key))
 
+&all-privkeys:: $(&PRIVKEYS)
+
+&TARGETS += $(&PRIVKEYS)
 &CLEAN += *.new