xref: /freebsd/share/examples/Makefile (revision 39beb93c3f8bdbf72a61fda42300b5ebed7390c8)
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	ibcs2 \
17	ipfw \
18	kld \
19	libvgl \
20	mdoc \
21	netgraph \
22	nwclient \
23	perfmon \
24	portal \
25	ppi \
26	ppp \
27	pppd \
28	printing \
29	ses \
30	scsi_target \
31	slattach \
32	sliplogin \
33	startslip \
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	bootforth/README \
47	bootforth/boot.4th \
48	bootforth/frames.4th \
49	bootforth/loader.rc \
50	bootforth/menu.4th \
51	bootforth/menuconf.4th \
52	bootforth/screen.4th \
53	cvsup/README \
54	cvsup/cvs-supfile \
55	cvsup/doc-supfile \
56	cvsup/gnats-supfile \
57	cvsup/ports-supfile \
58	cvsup/refuse \
59	cvsup/refuse.README \
60	cvsup/stable-supfile \
61	cvsup/standard-supfile \
62	cvsup/www-supfile \
63	diskless/ME \
64	diskless/README.BOOTP \
65	diskless/README.TEMPLATING \
66	diskless/clone_root \
67	drivers/README \
68	drivers/make_device_driver.sh \
69	drivers/make_pseudo_driver.sh \
70	etc/README.examples \
71	etc/bsd-style-copyright \
72	etc/make.conf \
73	find_interface/Makefile \
74	find_interface/README \
75	find_interface/find_interface.c \
76	ibcs2/README \
77	ibcs2/hello.uu \
78	ipfw/change_rules.sh \
79	kld/Makefile \
80	kld/cdev/Makefile \
81	kld/cdev/README \
82	kld/cdev/module/Makefile \
83	kld/cdev/module/cdev.c \
84	kld/cdev/module/cdev.h \
85	kld/cdev/module/cdevmod.c \
86	kld/cdev/test/Makefile \
87	kld/cdev/test/testcdev.c \
88	kld/dyn_sysctl/Makefile \
89	kld/dyn_sysctl/README \
90	kld/dyn_sysctl/dyn_sysctl.c \
91	kld/syscall/Makefile \
92	kld/syscall/module/Makefile \
93	kld/syscall/module/syscall.c \
94	kld/syscall/test/Makefile \
95	kld/syscall/test/call.c \
96	libvgl/Makefile \
97	libvgl/demo.c \
98	mdoc/POSIX-copyright \
99	mdoc/deshallify.sh \
100	mdoc/example.1 \
101	mdoc/example.3 \
102	mdoc/example.4 \
103	mdoc/example.9 \
104	netgraph/ether.bridge \
105	netgraph/frame_relay \
106	netgraph/ngctl \
107	netgraph/raw \
108	netgraph/udp.tunnel \
109	nwclient/dot.nwfsrc \
110	nwclient/nwfs.sh.sample \
111	perfmon/Makefile \
112	perfmon/README \
113	perfmon/perfmon.c \
114	portal/README \
115	portal/portal.conf \
116	ppi/Makefile \
117	ppi/ppilcd.c \
118	ppp/chap-auth \
119	ppp/login-auth \
120	ppp/ppp.conf.sample \
121	ppp/ppp.conf.span-isp \
122	ppp/ppp.conf.span-isp.working \
123	ppp/ppp.linkdown.sample \
124	ppp/ppp.linkdown.span-isp \
125	ppp/ppp.linkdown.span-isp.working \
126	ppp/ppp.linkup.sample \
127	ppp/ppp.linkup.span-isp \
128	ppp/ppp.linkup.span-isp.working \
129	ppp/ppp.secret.sample \
130	ppp/ppp.secret.span-isp \
131	ppp/ppp.secret.span-isp.working \
132	pppd/auth-down.sample \
133	pppd/auth-up.sample \
134	pppd/chap-secrets.sample \
135	pppd/chat.sh.sample \
136	pppd/ip-down.sample \
137	pppd/ip-up.sample \
138	pppd/options.sample \
139	pppd/pap-secrets.sample \
140	pppd/ppp.deny.sample \
141	pppd/ppp.shells.sample \
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	slattach/unit-command.sh \
185	sliplogin/slip.hosts \
186	sliplogin/slip.login \
187	sliplogin/slip.logout \
188	sliplogin/slip.slparms \
189	startslip/sldown.sh \
190	startslip/slip.sh \
191	startslip/slup.sh \
192	sunrpc/Makefile \
193	sunrpc/dir/Makefile \
194	sunrpc/dir/dir.x \
195	sunrpc/dir/dir_proc.c \
196	sunrpc/dir/rls.c \
197	sunrpc/msg/Makefile \
198	sunrpc/msg/msg.x \
199	sunrpc/msg/msg_proc.c \
200	sunrpc/msg/printmsg.c \
201	sunrpc/msg/rprintmsg.c \
202	sunrpc/sort/Makefile \
203	sunrpc/sort/rsort.c \
204	sunrpc/sort/sort.x \
205	sunrpc/sort/sort_proc.c
206
207BINDIR= ${SHAREDIR}/examples
208
209NO_OBJ=
210
211# Define SHARED to indicate whether you want symbolic links to the system
212# source (``symlinks''), or a separate copy (``copies''); (latter useful
213# in environments where it's not possible to keep /sys publicly readable)
214SHARED?=	copies
215
216beforeinstall: ${SHARED} etc-examples
217.ORDER: ${SHARED} etc-examples
218
219copies:
220.for i in ${LDIRS}
221	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
222		rm -f ${DESTDIR}${BINDIR}/$i; \
223	fi
224.endfor
225	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
226	    -f ${.CURDIR}/../../etc/mtree/BSD.usr.dist -p ${DESTDIR}/usr
227.for file in ${XFILES}
228	${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
229		${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
230.endfor
231
232symlinks:
233.for i in ${LDIRS}
234	rm -rf ${DESTDIR}${BINDIR}/$i
235	ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
236.endfor
237
238etc-examples:
239.if ${SHARED} != "symlinks"
240	(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
241.endif
242
243.if ${SHARED} != "symlinks"
244SUBDIR=	smbfs
245.if ${MK_IPFILTER} != "no"
246SUBDIR+=ipfilter
247.endif
248.if ${MK_PF} != "no"
249SUBDIR+=pf
250.endif
251.endif
252
253.include <bsd.subdir.mk>
254