150476Speter# $FreeBSD: releng/11.0/share/examples/Makefile 301479 2016-06-06 02:43:41Z araujo $
21987Swollman#
31987Swollman# Doing a make install builds /usr/share/examples
41987Swollman
5265420Simp.include <src.opts.mk>
6156813Sru
7299293SgjbPACKAGE=examples
8299293SgjbFILESDIR=	${SHAREDIR}/examples
9299293Sgjb
10299293Sgjb.for _XFILE in ${XFILES}
11299293SgjbFILESGROUPS+=	${_XFILE}
12299293SgjbPACKAGE_${_XFILE}?=examples
13299293Sgjb${_XFILE}DIR=	${SHAREDIR}/examples/${_XFILE:H}
14299293Sgjb.endfor
15299293Sgjb
16100346SruLDIRS=	BSD_daemon \
17100346Sru	FreeBSD_version \
18100346Sru	IPv6 \
19100346Sru	bootforth \
20233429Seadler	csh \
21100346Sru	diskless \
22100346Sru	drivers \
23100346Sru	etc \
24100346Sru	find_interface \
25100346Sru	ibcs2 \
26206996Savg	indent \
27100346Sru	ipfw \
28214309Sjulian	jails \
29100346Sru	kld \
30100346Sru	libvgl \
31100346Sru	mdoc \
32100346Sru	netgraph \
33100346Sru	perfmon \
34100346Sru	ppi \
35100346Sru	ppp \
36100346Sru	printing \
37100346Sru	ses \
38100346Sru	scsi_target \
39279317Strasz	sunrpc \
40301479Saraujo	uefisign \
41301479Saraujo	ypldap
424257Sphk
43100346SruXFILES=	BSD_daemon/FreeBSD.pfa \
44100346Sru	BSD_daemon/README \
45100346Sru	BSD_daemon/beastie.eps \
46100346Sru	BSD_daemon/beastie.fig \
47100346Sru	BSD_daemon/eps.patch \
48100346Sru	BSD_daemon/poster.sh \
49100346Sru	FreeBSD_version/FreeBSD_version.c \
50100346Sru	FreeBSD_version/Makefile \
51100346Sru	FreeBSD_version/README \
52100346Sru	IPv6/USAGE \
53100346Sru	bootforth/README \
54100346Sru	bootforth/boot.4th \
55100346Sru	bootforth/frames.4th \
56100346Sru	bootforth/loader.rc \
57100346Sru	bootforth/menu.4th \
58100346Sru	bootforth/menuconf.4th \
59100346Sru	bootforth/screen.4th \
60233429Seadler	csh/dot.cshrc \
61100346Sru	diskless/ME \
62100346Sru	diskless/README.BOOTP \
63100346Sru	diskless/README.TEMPLATING \
64100346Sru	diskless/clone_root \
65100346Sru	drivers/README \
66100346Sru	drivers/make_device_driver.sh \
67100346Sru	drivers/make_pseudo_driver.sh \
68100346Sru	etc/README.examples \
69100346Sru	etc/bsd-style-copyright \
70100346Sru	etc/make.conf \
71100346Sru	find_interface/Makefile \
72100346Sru	find_interface/README \
73100346Sru	find_interface/find_interface.c \
74100346Sru	ibcs2/README \
75100346Sru	ibcs2/hello.uu \
76206996Savg	indent/indent.pro \
77100346Sru	ipfw/change_rules.sh \
78214309Sjulian	jails/README \
79100346Sru	kld/Makefile \
80100346Sru	kld/cdev/Makefile \
81100346Sru	kld/cdev/README \
82100346Sru	kld/cdev/module/Makefile \
83100346Sru	kld/cdev/module/cdev.c \
84100346Sru	kld/cdev/module/cdev.h \
85100346Sru	kld/cdev/module/cdevmod.c \
86100346Sru	kld/cdev/test/Makefile \
87100346Sru	kld/cdev/test/testcdev.c \
88100346Sru	kld/dyn_sysctl/Makefile \
89100346Sru	kld/dyn_sysctl/README \
90100346Sru	kld/dyn_sysctl/dyn_sysctl.c \
91200440Santoine	kld/firmware/Makefile \
92200440Santoine	kld/firmware/README \
93200440Santoine	kld/firmware/fwconsumer/Makefile \
94200440Santoine	kld/firmware/fwconsumer/fw_consumer.c \
95200440Santoine	kld/firmware/fwimage/Makefile \
96220256Semaste	kld/firmware/fwimage/firmware.img.uu \
97218914Slstewart	kld/khelp/Makefile \
98218914Slstewart	kld/khelp/README \
99218914Slstewart	kld/khelp/h_example.c \
100100346Sru	kld/syscall/Makefile \
101100346Sru	kld/syscall/module/Makefile \
102100346Sru	kld/syscall/module/syscall.c \
103100346Sru	kld/syscall/test/Makefile \
104100346Sru	kld/syscall/test/call.c \
105100346Sru	libvgl/Makefile \
106100346Sru	libvgl/demo.c \
107139989Ssimon	mdoc/POSIX-copyright \
108139989Ssimon	mdoc/deshallify.sh \
109100346Sru	mdoc/example.1 \
110100346Sru	mdoc/example.3 \
111100346Sru	mdoc/example.4 \
112140134Skeramida	mdoc/example.9 \
113100346Sru	netgraph/ether.bridge \
114100346Sru	netgraph/frame_relay \
115100346Sru	netgraph/ngctl \
116100346Sru	netgraph/raw \
117100346Sru	netgraph/udp.tunnel \
118214309Sjulian	netgraph/virtual.chain \
119214309Sjulian	netgraph/virtual.lan \
120100346Sru	perfmon/Makefile \
121100346Sru	perfmon/README \
122100346Sru	perfmon/perfmon.c \
123100346Sru	ppi/Makefile \
124100346Sru	ppi/ppilcd.c \
125100346Sru	ppp/chap-auth \
126100346Sru	ppp/login-auth \
127100346Sru	ppp/ppp.conf.sample \
128100346Sru	ppp/ppp.conf.span-isp \
129100346Sru	ppp/ppp.conf.span-isp.working \
130100346Sru	ppp/ppp.linkdown.sample \
131100346Sru	ppp/ppp.linkdown.span-isp \
132100346Sru	ppp/ppp.linkdown.span-isp.working \
133100346Sru	ppp/ppp.linkup.sample \
134100346Sru	ppp/ppp.linkup.span-isp \
135100346Sru	ppp/ppp.linkup.span-isp.working \
136100346Sru	ppp/ppp.secret.sample \
137100346Sru	ppp/ppp.secret.span-isp \
138100346Sru	ppp/ppp.secret.span-isp.working \
139100346Sru	printing/README \
140100346Sru	printing/diablo-if-net \
141100346Sru	printing/hpdf \
142100346Sru	printing/hpif \
143100346Sru	printing/hpof \
144100346Sru	printing/hprf \
145100346Sru	printing/hpvf \
146100346Sru	printing/if-simple \
147100346Sru	printing/if-simpleX \
148100346Sru	printing/ifhp \
149100346Sru	printing/make-ps-header \
150100346Sru	printing/netprint \
151100346Sru	printing/psdf \
152100346Sru	printing/psdfX \
153100346Sru	printing/psif \
154100346Sru	printing/pstf \
155100346Sru	printing/pstfX \
156100346Sru	ses/Makefile \
157100346Sru	ses/Makefile.inc \
158100346Sru	ses/getencstat/Makefile \
159100346Sru	ses/getencstat/getencstat.0 \
160100346Sru	ses/sesd/Makefile \
161100346Sru	ses/sesd/sesd.0 \
162100346Sru	ses/setencstat/Makefile \
163100346Sru	ses/setencstat/setencstat.0 \
164100346Sru	ses/setobjstat/Makefile \
165100346Sru	ses/setobjstat/setobjstat.0 \
166100346Sru	ses/srcs/chpmon.c \
167100346Sru	ses/srcs/eltsub.c \
168222337Smav	ses/srcs/eltsub.h \
169100346Sru	ses/srcs/getencstat.c \
170100346Sru	ses/srcs/getnobj.c \
171100346Sru	ses/srcs/getobjmap.c \
172100346Sru	ses/srcs/getobjstat.c \
173100346Sru	ses/srcs/inienc.c \
174100346Sru	ses/srcs/sesd.c \
175100346Sru	ses/srcs/setencstat.c \
176100346Sru	ses/srcs/setobjstat.c \
177100346Sru	scsi_target/Makefile \
178100346Sru	scsi_target/scsi_target.c \
179107215Snjl	scsi_target/scsi_target.h \
180107215Snjl	scsi_target/scsi_target.8 \
181107215Snjl	scsi_target/scsi_cmds.c \
182100346Sru	sunrpc/Makefile \
183100346Sru	sunrpc/dir/Makefile \
184100346Sru	sunrpc/dir/dir.x \
185100346Sru	sunrpc/dir/dir_proc.c \
186100346Sru	sunrpc/dir/rls.c \
187100346Sru	sunrpc/msg/Makefile \
188100346Sru	sunrpc/msg/msg.x \
189100346Sru	sunrpc/msg/msg_proc.c \
190100346Sru	sunrpc/msg/printmsg.c \
191100346Sru	sunrpc/msg/rprintmsg.c \
192100346Sru	sunrpc/sort/Makefile \
193100346Sru	sunrpc/sort/rsort.c \
194100346Sru	sunrpc/sort/sort.x \
195279317Strasz	sunrpc/sort/sort_proc.c \
196301479Saraujo	uefisign/uefikeys \
197301479Saraujo	ypldap/ypldap.conf
1984257Sphk
199100346SruBINDIR= ${SHAREDIR}/examples
2001987Swollman
201277725Sngie.if ${MK_HAST} != "no"
202277725SngieLDIRS+=		hast
203277725SngieXFILES+=	hast/ucarp.sh \
204277725Sngie		hast/ucarp_down.sh \
205277725Sngie		hast/ucarp_up.sh \
206277725Sngie		hast/vip-down.sh \
207277725Sngie		hast/vip-up.sh
208277725Sngie.endif
209277725Sngie
210278202Sngie.if ${MK_USB} != "no"
211278202SngieLDIRS+=		libusb20
212278202SngieXFILES+=	libusb20/Makefile \
213278202Sngie		libusb20/README \
214278202Sngie		libusb20/util.c \
215278202Sngie		libusb20/util.h \
216278202Sngie		libusb20/bulk.c \
217278202Sngie		libusb20/control.c
218278202Sngie.endif
219278202Sngie
220277727Sngie.if ${MACHINE_CPUARCH} == "amd64"
221277727Sngie.if ${MK_BHYVE} != "no"
222277727SngieLDIRS+=		bhyve
223277727SngieXFILES+=	bhyve/vmrun.sh
224298107SgjbPACKAGE_bhyve/vmrun.sh=	bhyve
225277727Sngie.endif
226277727Sngie.endif
227277727Sngie
22854351Smarcel# Define SHARED to indicate whether you want symbolic links to the system
22954351Smarcel# source (``symlinks''), or a separate copy (``copies''); (latter useful
23054351Smarcel# in environments where it's not possible to keep /sys publicly readable)
23154351SmarcelSHARED?=	copies
23254351Smarcel
233100346Srubeforeinstall: ${SHARED} etc-examples
234296700SbdreweryMETA_TARGETS+=	copies symlinks
235100346Sru.ORDER: ${SHARED} etc-examples
2362365Sbde
237297994Sbdrewerycopies:
238100346Sru.for i in ${LDIRS}
239104288Sru	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
240100346Sru		rm -f ${DESTDIR}${BINDIR}/$i; \
241100346Sru	fi
24213537Sbde.endfor
243100346Sru	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
244100346Sru	    -f ${.CURDIR}/../../etc/mtree/BSD.usr.dist -p ${DESTDIR}/usr
245100346Sru.for file in ${XFILES}
246299293Sgjb	${INSTALL} -T package=${PACKAGE_${file}:Uexamples} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
247100346Sru		${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
24813537Sbde.endfor
2491987Swollman
250297994Sbdrewerysymlinks:
251100346Sru.for i in ${LDIRS}
252100346Sru	rm -rf ${DESTDIR}${BINDIR}/$i
253100346Sru	ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
25454351Smarcel.endfor
25554351Smarcel
25654351Smarceletc-examples:
25754351Smarcel.if ${SHARED} != "symlinks"
258296695Sbdrewery	${_+_}(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
25954351Smarcel.endif
26054351Smarcel
26185214Sdarrenr.if ${SHARED} != "symlinks"
262252356SdavideSUBDIR=	smbfs
263156813Sru.if ${MK_IPFILTER} != "no"
26492868SruSUBDIR+=ipfilter
26585214Sdarrenr.endif
266156813Sru.if ${MK_PF} != "no"
267135184SmlaierSUBDIR+=pf
26892868Sru.endif
269135184Smlaier.endif
27085214Sdarrenr
271258299Sjmmv.if ${MK_TESTS} != "no"
272258299SjmmvSUBDIR+=tests
273258299Sjmmv.endif
274258299Sjmmv
275289393SbdrewerySUBDIR_PARALLEL=
276289393Sbdrewery
277296695Sbdrewery.include <bsd.prog.mk>
278