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