xref: /freebsd/share/examples/Makefile (revision 7f3dea244c40159a41ab22da77a434d7c5b5e85a)
17f3dea24SPeter Wemm# $FreeBSD$
299e4ba42SGarrett Wollman#
399e4ba42SGarrett Wollman# Doing a make install builds /usr/share/examples
499e4ba42SGarrett Wollman
5eb646a75SBruce EvansDIRS!=	for i in *; do if test -d $$i -a $$i != CVS; then echo $$i; fi; done
6ca6aa03bSPoul-Henning Kamp
7ca6aa03bSPoul-Henning KampDDIR=	${DESTDIR}/usr/share/examples
8ca6aa03bSPoul-Henning Kamp
9c19cbc80SBruce EvansNOOBJ=	noobj
1099e4ba42SGarrett Wollman
1199e4ba42SGarrett Wollman# Define SHARED to indicate whether you want symbolic links to the system
1299e4ba42SGarrett Wollman# source (``symlinks''), or a separate copy (``copies''); (latter useful
1399e4ba42SGarrett Wollman# in environments where it's not possible to keep /sys publicly readable)
1499e4ba42SGarrett WollmanSHARED?=	copies
1599e4ba42SGarrett Wollman
16c19cbc80SBruce Evansall clean cleandir depend lint tags:
17c19cbc80SBruce Evans
185aae9955SSheldon Hearnbeforeinstall: etc-examples ${SHARED}
1999e4ba42SGarrett Wollman
20eb646a75SBruce Evans.for dir in ${DIRS}
21df3f7155SJordan K. HubbardFILES!=	find -L ${dir} \( -name CVS -prune \) -o -type f -print
22eb646a75SBruce Evans.for file in ${FILES}
23eb646a75SBruce Evanscopies::
248cd33d23SBruce Evans	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${file} ${DDIR}/${file}
25eb646a75SBruce Evans.endfor
26eb646a75SBruce Evans.endfor
2799e4ba42SGarrett Wollman
28eb646a75SBruce Evans.for dir in ${DIRS}
29eb646a75SBruce Evanssymlinks::
30eb646a75SBruce Evans	rm -rf ${DDIR}/${dir}; ln -s ${.CURDIR}/${dir} ${DDIR}
31eb646a75SBruce Evans.endfor
3299e4ba42SGarrett Wollman
335aae9955SSheldon Hearnetc-examples:
346bef9f10SSheldon Hearn.if ${SHARED} != "symlinks"
355aae9955SSheldon Hearn	(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
366bef9f10SSheldon Hearn.endif
375aae9955SSheldon Hearn
3899e4ba42SGarrett Wollman.include <bsd.prog.mk>
39