Makefile revision 280419
1# $FreeBSD: stable/10/share/examples/Makefile 280419 2015-03-24 06:55:08Z ngie $
2#
3# Doing a make install builds /usr/share/examples
4
5.include <bsd.own.mk>
6
7LDIRS=	BSD_daemon \
8	FreeBSD_version \
9	IPv6 \
10	bootforth \
11	csh \
12	diskless \
13	drivers \
14	etc \
15	find_interface \
16	ibcs2 \
17	indent \
18	ipfw \
19	jails \
20	kld \
21	libvgl \
22	mdoc \
23	netgraph \
24	perfmon \
25	ppi \
26	ppp \
27	printing \
28	ses \
29	scsi_target \
30	sunrpc
31
32XFILES=	BSD_daemon/FreeBSD.pfa \
33	BSD_daemon/README \
34	BSD_daemon/beastie.eps \
35	BSD_daemon/beastie.fig \
36	BSD_daemon/eps.patch \
37	BSD_daemon/poster.sh \
38	FreeBSD_version/FreeBSD_version.c \
39	FreeBSD_version/Makefile \
40	FreeBSD_version/README \
41	IPv6/USAGE \
42	bootforth/README \
43	bootforth/boot.4th \
44	bootforth/frames.4th \
45	bootforth/loader.rc \
46	bootforth/menu.4th \
47	bootforth/menuconf.4th \
48	bootforth/screen.4th \
49	csh/dot.cshrc \
50	diskless/ME \
51	diskless/README.BOOTP \
52	diskless/README.TEMPLATING \
53	diskless/clone_root \
54	drivers/README \
55	drivers/make_device_driver.sh \
56	drivers/make_pseudo_driver.sh \
57	etc/README.examples \
58	etc/bsd-style-copyright \
59	etc/make.conf \
60	find_interface/Makefile \
61	find_interface/README \
62	find_interface/find_interface.c \
63	ibcs2/README \
64	ibcs2/hello.uu \
65	indent/indent.pro \
66	ipfw/change_rules.sh \
67	jails/README \
68	kld/Makefile \
69	kld/cdev/Makefile \
70	kld/cdev/README \
71	kld/cdev/module/Makefile \
72	kld/cdev/module/cdev.c \
73	kld/cdev/module/cdev.h \
74	kld/cdev/module/cdevmod.c \
75	kld/cdev/test/Makefile \
76	kld/cdev/test/testcdev.c \
77	kld/dyn_sysctl/Makefile \
78	kld/dyn_sysctl/README \
79	kld/dyn_sysctl/dyn_sysctl.c \
80	kld/firmware/Makefile \
81	kld/firmware/README \
82	kld/firmware/fwconsumer/Makefile \
83	kld/firmware/fwconsumer/fw_consumer.c \
84	kld/firmware/fwimage/Makefile \
85	kld/firmware/fwimage/firmware.img.uu \
86	kld/khelp/Makefile \
87	kld/khelp/README \
88	kld/khelp/h_example.c \
89	kld/syscall/Makefile \
90	kld/syscall/module/Makefile \
91	kld/syscall/module/syscall.c \
92	kld/syscall/test/Makefile \
93	kld/syscall/test/call.c \
94	libvgl/Makefile \
95	libvgl/demo.c \
96	mdoc/POSIX-copyright \
97	mdoc/deshallify.sh \
98	mdoc/example.1 \
99	mdoc/example.3 \
100	mdoc/example.4 \
101	mdoc/example.9 \
102	netgraph/ether.bridge \
103	netgraph/frame_relay \
104	netgraph/ngctl \
105	netgraph/raw \
106	netgraph/udp.tunnel \
107	netgraph/virtual.chain \
108	netgraph/virtual.lan \
109	perfmon/Makefile \
110	perfmon/README \
111	perfmon/perfmon.c \
112	ppi/Makefile \
113	ppi/ppilcd.c \
114	ppp/chap-auth \
115	ppp/login-auth \
116	ppp/ppp.conf.sample \
117	ppp/ppp.conf.span-isp \
118	ppp/ppp.conf.span-isp.working \
119	ppp/ppp.linkdown.sample \
120	ppp/ppp.linkdown.span-isp \
121	ppp/ppp.linkdown.span-isp.working \
122	ppp/ppp.linkup.sample \
123	ppp/ppp.linkup.span-isp \
124	ppp/ppp.linkup.span-isp.working \
125	ppp/ppp.secret.sample \
126	ppp/ppp.secret.span-isp \
127	ppp/ppp.secret.span-isp.working \
128	printing/README \
129	printing/diablo-if-net \
130	printing/hpdf \
131	printing/hpif \
132	printing/hpof \
133	printing/hprf \
134	printing/hpvf \
135	printing/if-simple \
136	printing/if-simpleX \
137	printing/ifhp \
138	printing/make-ps-header \
139	printing/netprint \
140	printing/psdf \
141	printing/psdfX \
142	printing/psif \
143	printing/pstf \
144	printing/pstfX \
145	ses/Makefile \
146	ses/Makefile.inc \
147	ses/getencstat/Makefile \
148	ses/getencstat/getencstat.0 \
149	ses/sesd/Makefile \
150	ses/sesd/sesd.0 \
151	ses/setencstat/Makefile \
152	ses/setencstat/setencstat.0 \
153	ses/setobjstat/Makefile \
154	ses/setobjstat/setobjstat.0 \
155	ses/srcs/chpmon.c \
156	ses/srcs/eltsub.c \
157	ses/srcs/eltsub.h \
158	ses/srcs/getencstat.c \
159	ses/srcs/getnobj.c \
160	ses/srcs/getobjmap.c \
161	ses/srcs/getobjstat.c \
162	ses/srcs/inienc.c \
163	ses/srcs/sesd.c \
164	ses/srcs/setencstat.c \
165	ses/srcs/setobjstat.c \
166	scsi_target/Makefile \
167	scsi_target/scsi_target.c \
168	scsi_target/scsi_target.h \
169	scsi_target/scsi_target.8 \
170	scsi_target/scsi_cmds.c \
171	sunrpc/Makefile \
172	sunrpc/dir/Makefile \
173	sunrpc/dir/dir.x \
174	sunrpc/dir/dir_proc.c \
175	sunrpc/dir/rls.c \
176	sunrpc/msg/Makefile \
177	sunrpc/msg/msg.x \
178	sunrpc/msg/msg_proc.c \
179	sunrpc/msg/printmsg.c \
180	sunrpc/msg/rprintmsg.c \
181	sunrpc/sort/Makefile \
182	sunrpc/sort/rsort.c \
183	sunrpc/sort/sort.x \
184	sunrpc/sort/sort_proc.c
185
186BINDIR= ${SHAREDIR}/examples
187
188NO_OBJ=
189
190.if ${MK_HAST} != "no"
191LDIRS+=		hast
192XFILES+=	hast/ucarp.sh \
193		hast/ucarp_down.sh \
194		hast/ucarp_up.sh \
195		hast/vip-down.sh \
196		hast/vip-up.sh
197.endif
198
199.if ${MK_USB} != "no"
200LDIRS+=		libusb20
201XFILES+=	libusb20/Makefile \
202		libusb20/README \
203		libusb20/util.c \
204		libusb20/util.h \
205		libusb20/bulk.c \
206		libusb20/control.c
207.endif
208
209.if ${MACHINE_CPUARCH} == "amd64"
210.if ${MK_BHYVE} != "no"
211LDIRS+=		bhyve
212XFILES+=	bhyve/vmrun.sh
213.endif
214.endif
215
216# Define SHARED to indicate whether you want symbolic links to the system
217# source (``symlinks''), or a separate copy (``copies''); (latter useful
218# in environments where it's not possible to keep /sys publicly readable)
219SHARED?=	copies
220
221beforeinstall: ${SHARED} etc-examples
222.ORDER: ${SHARED} etc-examples
223
224copies:
225.for i in ${LDIRS}
226	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
227		rm -f ${DESTDIR}${BINDIR}/$i; \
228	fi
229.endfor
230	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
231	    -f ${.CURDIR}/../../etc/mtree/BSD.usr.dist -p ${DESTDIR}/usr
232.for file in ${XFILES}
233	${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
234		${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
235.endfor
236
237symlinks:
238.for i in ${LDIRS}
239	rm -rf ${DESTDIR}${BINDIR}/$i
240	ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
241.endfor
242
243etc-examples:
244.if ${SHARED} != "symlinks"
245	(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
246.endif
247
248.if ${SHARED} != "symlinks"
249SUBDIR=	smbfs
250.if ${MK_IPFILTER} != "no"
251SUBDIR+=ipfilter
252.endif
253.if ${MK_PF} != "no"
254SUBDIR+=pf
255.endif
256.endif
257
258.if ${MK_TESTS} != "no"
259SUBDIR+=tests
260.endif
261
262.include <bsd.subdir.mk>
263