xref: /freebsd/share/examples/Makefile (revision 1f474190)
1# $FreeBSD$
2#
3# Doing a make install builds /usr/share/examples
4
5.include <src.opts.mk>
6
7PACKAGE=examples
8FILESDIR=	${SHAREDIR}/examples
9
10LDIRS=	BSD_daemon \
11	FreeBSD_version \
12	IPv6 \
13	bootforth \
14	csh \
15	diskless \
16	drivers \
17	etc \
18	find_interface \
19	flua \
20	indent \
21	ipfw \
22	jails \
23	kld \
24	libvgl \
25	mdoc \
26	netgraph \
27	perfmon \
28	ppi \
29	ppp \
30	printing \
31	ses \
32	scsi_target \
33	sunrpc \
34	ypldap
35
36
37SE_DIRS+=	BSD_daemon
38SE_BSD_DAEMON= \
39	FreeBSD.pfa \
40	README \
41	beastie.eps \
42	beastie.fig \
43	eps.patch \
44	poster.sh
45
46.if ${MACHINE_CPUARCH} == "amd64"
47.if ${MK_BHYVE} != "no"
48LDIRS+=		bhyve
49SE_DIRS+=	bhyve
50SE_BHYVE=	vmrun.sh
51PACKAGE_bhyve/vmrun.sh=	bhyve
52.endif
53.endif
54
55SE_DIRS+=	FreeBSD_version
56SE_FREEBSD_VERSION= \
57	FreeBSD_version.c \
58	Makefile \
59	README
60
61SE_DIRS+=	IPv6
62SE_IPV6=	USAGE
63
64SE_DIRS+=	bootforth
65SE_BOOTFORTH= \
66	README \
67	boot.4th \
68	frames.4th \
69	loader.rc \
70	menu.4th \
71	menuconf.4th \
72	screen.4th
73
74SE_DIRS+=	csh
75SE_CSH=	dot.cshrc
76
77SE_DIRS+=	diskless
78SE_DISKLESS= \
79	ME \
80	README.BOOTP \
81	README.TEMPLATING \
82	clone_root
83
84SE_DIRS+=	drivers
85SE_DRIVERS= \
86	README \
87	make_device_driver.sh \
88	make_pseudo_driver.sh
89
90SE_DIRS+=	etc
91SE_ETC= \
92	README.examples \
93	bsd-style-copyright \
94	make.conf
95
96SE_DIRS+=	find_interface
97SE_FIND_INTERFACE= \
98	Makefile \
99	README \
100	find_interface.c
101
102SE_DIRS+=	flua
103SE_FLUA=	libjail.lua
104
105SE_DIRS+=	indent
106SE_INDENT=	indent.pro
107
108.if ${MK_IPFILTER} != "no"
109SUBDIR+=	ipfilter
110.endif
111
112SE_DIRS+=	ipfw
113SE_IPFW=	change_rules.sh
114
115SE_DIRS+=	jails
116SE_JAILS= \
117	README \
118	VIMAGE \
119	jail.xxx.conf \
120	jib \
121	jng \
122	rc.conf.jails \
123	rcjail.xxx.conf
124
125SE_DIRS+=	kld
126SE_KLD=	Makefile
127
128SE_DIRS+=	kld/cdev
129SE_KLD_CDEV= \
130	Makefile \
131	README \
132
133SE_DIRS+=	kld/cdev/module
134SE_KLD_CDEV_MODULE= \
135	Makefile \
136	cdev.c \
137	cdev.h \
138	cdevmod.c
139
140SE_DIRS+=	kld/cdev/test
141SE_KLD_CDEV_TEST= \
142	Makefile \
143	testcdev.c
144
145SE_DIRS+=	kld/dyn_sysctl
146SE_KLD_DYN_SYSCTL= \
147	Makefile \
148	README \
149	dyn_sysctl.c
150
151SE_DIRS+=	kld/firmware
152SE_KLD_FIRMWARE= \
153	Makefile \
154	README
155
156SE_DIRS+=	kld/firmware/fwconsumer
157SE_KLD_FIRMWARE_FWCONSUMER= \
158	Makefile \
159	fw_consumer.c
160
161SE_DIRS+=	kld/firmware/fwimage
162SE_KLD_FIRMWARE_FWIMAGE= \
163	Makefile \
164	firmware.img.uu
165
166SE_DIRS+=	kld/khelp
167SE_KLD_KHELP= \
168	Makefile \
169	README \
170	h_example.c
171
172SE_DIRS+=	kld/syscall
173SE_KLD_SYSCALL=	Makefile
174
175SE_DIRS+=	kld/syscall/module
176SE_KLD_SYSCALL_MODULE= \
177	Makefile \
178	syscall.c
179
180SE_DIRS+=	kld/syscall/test
181SE_KLD_SYSCALL_TEST= \
182	Makefile \
183	call.c
184
185SE_DIRS+=	libvgl
186SE_LIBVGL=	\
187	Makefile \
188	demo.c
189
190SE_DIRS+=	mdoc
191SE_MDOC= \
192	POSIX-copyright \
193	deshallify.sh \
194	example.1 \
195	example.3 \
196	example.4 \
197	example.9
198
199SE_DIRS+=	netgraph
200SE_NETGRAPH= \
201	ether.bridge \
202	frame_relay \
203	ngctl \
204	raw \
205	udp.tunnel \
206	virtual.chain \
207	virtual.lan \
208
209SE_DIRS+=	perfmon
210SE_PERFMON= \
211	Makefile \
212	README \
213	perfmon.c \
214
215.if ${MK_PF} != "no"
216SE_DIRS+=	pf
217SE_PF= \
218	ackpri \
219	faq-example1 \
220	faq-example2 \
221	faq-example3 \
222	pf.conf \
223	queue1 \
224	queue2 \
225	queue3 \
226	queue4 \
227	spamd
228.endif
229
230SE_DIRS+=	ppi
231SE_PPI= \
232	Makefile \
233	ppilcd.c
234
235SE_DIRS+=	ppp
236SE_PPP= \
237	chap-auth \
238	login-auth \
239	ppp.conf.sample \
240	ppp.conf.span-isp \
241	ppp.conf.span-isp.working \
242	ppp.linkdown.sample \
243	ppp.linkdown.span-isp \
244	ppp.linkdown.span-isp.working \
245	ppp.linkup.sample \
246	ppp.linkup.span-isp \
247	ppp.linkup.span-isp.working \
248	ppp.secret.sample \
249	ppp.secret.span-isp \
250	ppp.secret.span-isp.working
251
252SE_DIRS+=	printing
253SE_PRINTING= \
254	diablo-if-net \
255	hpdf \
256	hpif \
257	hpof \
258	hprf \
259	hpvf \
260	if-simple \
261	if-simpleX \
262	ifhp \
263	make-ps-header \
264	netprint \
265	psdf \
266	psdfX \
267	psif \
268	pstf \
269	pstfX
270
271SE_DIRS+=	ses
272SE_SES= \
273	Makefile \
274	Makefile.inc
275
276SE_DIRS+=	ses/getencstat
277SE_SES_GETENCSTAT= \
278	Makefile \
279	getencstat.0
280
281SE_DIRS+=	ses/sesd
282SE_SES_SESD= \
283	Makefile \
284	sesd.0
285
286SE_DIRS+=	ses/setencstat
287SE_SES_SETENCSTAT= \
288	Makefile \
289	setencstat.0
290
291SE_DIRS+=	ses/setobjstat
292SE_SES_SETOBJSTAT= \
293	Makefile \
294	setobjstat.0
295
296SE_DIRS+=	ses/srcs
297SE_SES_SRCS= \
298	chpmon.c \
299	eltsub.c \
300	eltsub.h \
301	getencstat.c \
302	getnobj.c \
303	getobjmap.c \
304	getobjstat.c \
305	inienc.c \
306	sesd.c \
307	setencstat.c \
308	setobjstat.c
309
310SE_DIRS+=	scsi_target
311SE_SCSI_TARGET= \
312	Makefile \
313	scsi_target.c \
314	scsi_target.h \
315	scsi_target.8 \
316	scsi_cmds.c
317
318SE_DIRS+=	sunrpc
319SE_SUNRPC=	Makefile
320
321SE_DIRS+=	sunrpc/dir
322SE_SUNRPC_DIR= \
323	Makefile \
324	dir.x \
325	dir_proc.c \
326	rls.c
327
328SE_DIRS+=	sunrpc/msg
329SE_SUNRPC_MSG= \
330	Makefile \
331	msg.x \
332	msg_proc.c \
333	printmsg.c \
334	rprintmsg.c
335
336SE_DIRS+=	sunrpc/sort
337SE_SUNRPC_SORT= \
338	Makefile \
339	rsort.c \
340	sort.x \
341	sort_proc.c
342
343.if ${MK_EFI} != "no"
344LDIRS+=		uefisign
345SE_DIRS+=	uefisign
346SE_UEFISIGN=	uefikeys
347.endif
348
349SE_DIRS+=	ypldap
350SE_YPLDAP=	ypldap.conf
351
352.if ${MK_HAST} != "no"
353LDIRS+=		hast
354SE_DIRS+=	hast
355SE_HAST=	ucarp.sh \
356	ucarp_down.sh \
357	ucarp_up.sh \
358	vip-down.sh \
359	vip-up.sh
360.endif
361
362.if ${MK_USB} != "no"
363LDIRS+=		libusb20
364SE_DIRS+=	libusb20
365SE_LIBUSB20= \
366	Makefile \
367	README \
368	util.c \
369	util.h \
370	bulk.c \
371	control.c
372.endif
373
374
375# Setup the FILES_GROUPS for all DIRS variables above.
376# The variables are prefixed by 'SE_' to prevent variable collision in
377# other parts of the system
378.for d in ${SE_DIRS}
379.for f in ${SE_${d:tu:C/\//_/g}}
380SER_${d:tu:C/\//_/g}+=	${d}/${f}
381.endfor
382FILESGROUPS+=	SER_${d:tu:C/\//_/g}
383SER_${d:tu:C/\//_/g}DIR+=	${SHAREDIR}/examples/${d}
384.endfor
385
386BINDIR= ${SHAREDIR}/examples
387
388beforeinstall: copies
389META_TARGETS+=	copies
390
391copies:
392.for i in ${LDIRS}
393	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
394		rm -f ${DESTDIR}${BINDIR}/$i; \
395	fi
396.endfor
397
398SUBDIR+=	smbfs
399
400HAS_TESTS=
401SUBDIR.${MK_TESTS}+= tests
402
403SUBDIR_PARALLEL=
404
405.include <bsd.prog.mk>
406