summaryrefslogtreecommitdiffstats
path: root/share/examples/Makefile
blob: d2cd800dd59add064338fa60753d5ae753512c5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# $FreeBSD$
#
# Doing a make install builds /usr/share/examples

DIRS!=	for i in *; do \
	    if test -d $$i -a $$i != CVS -a \
		$$i != ipfilter -a $$i != smbfs; then \
		echo $$i; \
	    fi; \
	done

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: etc-examples ${SHARED}

.for dir in ${DIRS}
FILES!=	find -L ${dir} \( -name CVS -prune \) -o -type f -print
.for file in ${FILES}
copies::
	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${file} ${DDIR}/${file}
.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

.if ${SHARED} != "symlinks"
SUBDIR=	smbfs
.if !defined(NO_IPFILTER)
SUBDIR+=ipfilter
.endif
.endif

.include <bsd.subdir.mk>
OpenPOWER on IntegriCloud