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