Makefile revision 85381
1# $FreeBSD: head/share/examples/Makefile 85381 2001-10-23 21:28:39Z markm $
2#
3# Doing a make install builds /usr/share/examples
4
5DIRS!=	for i in *; do \
6	    if test -d $$i -a $$i != CVS -a $$i != ipfilter; then \
7		echo $$i; \
8	    fi; \
9	done
10
11DDIR=	${DESTDIR}/usr/share/examples
12
13NOOBJ=	noobj
14
15# Define SHARED to indicate whether you want symbolic links to the system
16# source (``symlinks''), or a separate copy (``copies''); (latter useful
17# in environments where it's not possible to keep /sys publicly readable)
18SHARED?=	copies
19
20all clean cleandir depend lint tags:
21
22beforeinstall: etc-examples ${SHARED}
23
24copies::
25
26.for dir in ${DIRS}
27FILES!=	find -L ${dir} \( -name CVS -prune \) -o -type f -print
28.for file in ${FILES}
29copies::
30	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${file} ${DDIR}/${file}
31.endfor
32.endfor
33
34symlinks::
35
36.for dir in ${DIRS}
37symlinks::
38	rm -rf ${DDIR}/${dir}; ln -s ${.CURDIR}/${dir} ${DDIR}
39.endfor
40
41etc-examples:
42.if ${SHARED} != "symlinks"
43	(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
44.endif
45
46.if ${SHARED} != "symlinks"
47SUBDIR=	ipfilter
48.endif
49
50.include <bsd.subdir.mk>
51