summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-09-17 21:43:27 +1200
committerDavid Phillips <david@sighup.nz>2017-09-17 21:43:27 +1200
commitf486bb096e6a405822d4a02718012fb395270d13 (patch)
tree5ea8c441ab8dc52df12e7a54bc1b1ec3930ee53d
parent5d3e5ec91e95abfe8487ad497eb8bf32e6ef39a8 (diff)
downloadinitscripts-f486bb096e6a405822d4a02718012fb395270d13.tar.xz
Add rough Makefile
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c8eb711
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+export OPENRC_RUN = /usr/bin/openrc-run
+export BINDIR = /usr/bin
+
+MACRO_PROG = ./replace.sh
+INIT_FILES = $(shell find init.d.in -type f | sed -e 's/\.in$$//g' -e 's/init\.d\.in/init.d/g')
+CONF_FILES = $(shell find conf.d.in -type f | sed -e 's/\.in$$//g' -e 's/conf\.d\.in/conf.d/g')
+
+all: $(INIT_FILES) $(CONF_FILES)
+
+init.d:
+ mkdir $@
+
+conf.d:
+ mkdir $@
+
+init.d/%: init.d.in/%.in init.d
+ $(MACRO_PROG) $< > $@
+
+conf.d/%: conf.d.in/%.in conf.d
+ $(MACRO_PROG) $< > $@
+
+.PHONY: clean
+clean:
+ rm $(INIT_FILES) $(CONF_FILES)