summaryrefslogtreecommitdiff
path: root/mk/scripts.mk
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-10 16:35:59 +0000
committerRoy Marples <roy@marples.name>2008-01-10 16:35:59 +0000
commit43147845209873b0776bd75d363913fe25611f49 (patch)
treeab3295c30664476d8d05b0fe5fe9ace702ade5ea /mk/scripts.mk
parent2643f2e605f102d2c2fa098d0cf5400d3795ed4a (diff)
downloadopenrc-43147845209873b0776bd75d363913fe25611f49.tar.gz
openrc-43147845209873b0776bd75d363913fe25611f49.tar.bz2
openrc-43147845209873b0776bd75d363913fe25611f49.tar.xz
Allow for OS and SUBOS folders so we can introduce NetBSD scripts whilst keeping BSD for all BSD's.
Diffstat (limited to 'mk/scripts.mk')
-rw-r--r--mk/scripts.mk34
1 files changed, 34 insertions, 0 deletions
diff --git a/mk/scripts.mk b/mk/scripts.mk
new file mode 100644
index 0000000..806a545
--- /dev/null
+++ b/mk/scripts.mk
@@ -0,0 +1,34 @@
+# Install rules for our scripts
+# Copyright 2007-2008 Roy Marples <roy@marples.name>
+
+# We store the contents of the directory for ease of use in Makefiles
+_CONTENTS_SH= ls -1 | grep -v Makefile | xargs
+_CONTENTS!= ${_CONTENTS_SH}
+CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
+
+INSTALL?= install
+
+include ${MK}/os.mk
+
+all:
+
+realinstall: ${BIN} ${CONF} ${CONF_APPEND}
+ if test -n "${DIR}"; then ${INSTALL} -d ${DESTDIR}${DIR} || exit $$?; fi
+ if test -n "${BIN}"; then ${INSTALL} ${BIN} ${DESTDIR}${DIR} || exit $$?; fi
+ if test -n "${INC}"; then ${INSTALL} -m 0644 ${INC} ${DESTDIR}${DIR} || exit $$?; fi
+ for x in ${CONF}; do \
+ if ! test -e ${DESTDIR}${DIR}/$$x; then \
+ ${INSTALL} -m 0644 $$x ${DESTDIR}${DIR} || exit $$?; \
+ fi; \
+ done
+ for x in ${CONF_APPEND}; do \
+ if test -e ${DESTDIR}${DIR}/$$x; then \
+ cat $$x >> ${DESTDIR}${DIR}/$$x || exit $$?; \
+ else \
+ ${INSTALL} -m 0644 $$x ${DESTDIR}${DIR} || exit $$?; \
+ fi; \
+ done
+
+install: realinstall ${INSTALLAFTER}
+
+clean: