xref: /freebsd/share/examples/Makefile (revision 66e576525d35c68fcb86f142ebaa5a448555c0c7)
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	kld \
21	libvgl \
22	mdoc \
23	netgraph \
24	nwclient \
25	perfmon \
26	portal \
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	bootforth/README \
45	bootforth/boot.4th \
46	bootforth/frames.4th \
47	bootforth/loader.rc \
48	bootforth/menu.4th \
49	bootforth/menuconf.4th \
50	bootforth/screen.4th \
51	cvsup/README \
52	cvsup/cvs-supfile \
53	cvsup/doc-supfile \
54	cvsup/gnats-supfile \
55	cvsup/ports-supfile \
56	cvsup/refuse \
57	cvsup/refuse.README \
58	cvsup/stable-supfile \
59	cvsup/standard-supfile \
60	cvsup/www-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	kld/Makefile \
84	kld/cdev/Makefile \
85	kld/cdev/README \
86	kld/cdev/module/Makefile \
87	kld/cdev/module/cdev.c \
88	kld/cdev/module/cdev.h \
89	kld/cdev/module/cdevmod.c \
90	kld/cdev/test/Makefile \
91	kld/cdev/test/testcdev.c \
92	kld/dyn_sysctl/Makefile \
93	kld/dyn_sysctl/README \
94	kld/dyn_sysctl/dyn_sysctl.c \
95	kld/firmware/Makefile \
96	kld/firmware/README \
97	kld/firmware/fwconsumer/Makefile \
98	kld/firmware/fwconsumer/fw_consumer.c \
99	kld/firmware/fwimage/Makefile \
100	kld/firmware/fwimage/firmware.img \
101	kld/syscall/Makefile \
102	kld/syscall/module/Makefile \
103	kld/syscall/module/syscall.c \
104	kld/syscall/test/Makefile \
105	kld/syscall/test/call.c \
106	libvgl/Makefile \
107	libvgl/demo.c \
108	mdoc/POSIX-copyright \
109	mdoc/deshallify.sh \
110	mdoc/example.1 \
111	mdoc/example.3 \
112	mdoc/example.4 \
113	mdoc/example.9 \
114	netgraph/ether.bridge \
115	netgraph/frame_relay \
116	netgraph/ngctl \
117	netgraph/raw \
118	netgraph/udp.tunnel \
119	nwclient/dot.nwfsrc \
120	nwclient/nwfs.sh.sample \
121	perfmon/Makefile \
122	perfmon/README \
123	perfmon/perfmon.c \
124	portal/README \
125	portal/portal.conf \
126	ppi/Makefile \
127	ppi/ppilcd.c \
128	ppp/chap-auth \
129	ppp/login-auth \
130	ppp/ppp.conf.sample \
131	ppp/ppp.conf.span-isp \
132	ppp/ppp.conf.span-isp.working \
133	ppp/ppp.linkdown.sample \
134	ppp/ppp.linkdown.span-isp \
135	ppp/ppp.linkdown.span-isp.working \
136	ppp/ppp.linkup.sample \
137	ppp/ppp.linkup.span-isp \
138	ppp/ppp.linkup.span-isp.working \
139	ppp/ppp.secret.sample \
140	ppp/ppp.secret.span-isp \
141	ppp/ppp.secret.span-isp.working \
142	printing/README \
143	printing/diablo-if-net \
144	printing/hpdf \
145	printing/hpif \
146	printing/hpof \
147	printing/hprf \
148	printing/hpvf \
149	printing/if-simple \
150	printing/if-simpleX \
151	printing/ifhp \
152	printing/make-ps-header \
153	printing/netprint \
154	printing/psdf \
155	printing/psdfX \
156	printing/psif \
157	printing/pstf \
158	printing/pstfX \
159	ses/Makefile \
160	ses/Makefile.inc \
161	ses/getencstat/Makefile \
162	ses/getencstat/getencstat.0 \
163	ses/sesd/Makefile \
164	ses/sesd/sesd.0 \
165	ses/setencstat/Makefile \
166	ses/setencstat/setencstat.0 \
167	ses/setobjstat/Makefile \
168	ses/setobjstat/setobjstat.0 \
169	ses/srcs/chpmon.c \
170	ses/srcs/eltsub.c \
171	ses/srcs/getencstat.c \
172	ses/srcs/getnobj.c \
173	ses/srcs/getobjmap.c \
174	ses/srcs/getobjstat.c \
175	ses/srcs/inienc.c \
176	ses/srcs/sesd.c \
177	ses/srcs/setencstat.c \
178	ses/srcs/setobjstat.c \
179	scsi_target/Makefile \
180	scsi_target/scsi_target.c \
181	scsi_target/scsi_target.h \
182	scsi_target/scsi_target.8 \
183	scsi_target/scsi_cmds.c \
184	sunrpc/Makefile \
185	sunrpc/dir/Makefile \
186	sunrpc/dir/dir.x \
187	sunrpc/dir/dir_proc.c \
188	sunrpc/dir/rls.c \
189	sunrpc/msg/Makefile \
190	sunrpc/msg/msg.x \
191	sunrpc/msg/msg_proc.c \
192	sunrpc/msg/printmsg.c \
193	sunrpc/msg/rprintmsg.c \
194	sunrpc/sort/Makefile \
195	sunrpc/sort/rsort.c \
196	sunrpc/sort/sort.x \
197	sunrpc/sort/sort_proc.c
198
199BINDIR= ${SHAREDIR}/examples
200
201NO_OBJ=
202
203# Define SHARED to indicate whether you want symbolic links to the system
204# source (``symlinks''), or a separate copy (``copies''); (latter useful
205# in environments where it's not possible to keep /sys publicly readable)
206SHARED?=	copies
207
208beforeinstall: ${SHARED} etc-examples
209.ORDER: ${SHARED} etc-examples
210
211copies:
212.for i in ${LDIRS}
213	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
214		rm -f ${DESTDIR}${BINDIR}/$i; \
215	fi
216.endfor
217	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
218	    -f ${.CURDIR}/../../etc/mtree/BSD.usr.dist -p ${DESTDIR}/usr
219.for file in ${XFILES}
220	${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
221		${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
222.endfor
223
224symlinks:
225.for i in ${LDIRS}
226	rm -rf ${DESTDIR}${BINDIR}/$i
227	ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
228.endfor
229
230etc-examples:
231.if ${SHARED} != "symlinks"
232	(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
233.endif
234
235.if ${SHARED} != "symlinks"
236SUBDIR=	smbfs
237.if ${MK_IPFILTER} != "no"
238SUBDIR+=ipfilter
239.endif
240.if ${MK_PF} != "no"
241SUBDIR+=pf
242.endif
243.endif
244
245.include <bsd.subdir.mk>
246