summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/examples/Makefile18
1 files changed, 16 insertions, 2 deletions
diff --git a/share/examples/Makefile b/share/examples/Makefile
index 1e07279..3591fc6 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -8,10 +8,14 @@ DDIR= ${DESTDIR}/usr/share/examples
NOOBJ= noobj
+# Define SHARED to indicate whether you want symbolic links to the system
+# source (``symlinks''), or a separate copy (``copies''); (latter useful
+# in environments where it's not possible to keep /sys publicly readable)
+SHARED?= copies
+
all clean cleandir depend lint tags:
-beforeinstall: copies
- (cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
+beforeinstall: etc-examples ${SHARED}
.for dir in ${DIRS}
FILES!= find -L ${dir} \( -name CVS -prune \) -o -type f -print
@@ -21,4 +25,14 @@ copies::
.endfor
.endfor
+.for dir in ${DIRS}
+symlinks::
+ rm -rf ${DDIR}/${dir}; ln -s ${.CURDIR}/${dir} ${DDIR}
+.endfor
+
+etc-examples:
+.if ${SHARED} != "symlinks"
+ (cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
+.endif
+
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud