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