xref: /freebsd/share/examples/Makefile (revision 895f86f15fbf6540071feb9328c3c50ed1f027b8)
1# $FreeBSD$
2#
3# Doing a make install builds /usr/share/examples
4
5.include <src.opts.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
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
262SUBDIR_PARALLEL=
263
264.include <bsd.subdir.mk>
265