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