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