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