xref: /freebsd/share/examples/Makefile (revision 1d386b48)
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
218.if ${MK_STAGING} == "no"
219SE_PF= \
220	ackpri \
221	faq-example1 \
222	faq-example2 \
223	faq-example3 \
224	pf.conf \
225	queue1 \
226	queue2 \
227	queue3 \
228	queue4 \
229	spamd
230.endif
231.endif
232
233SE_DIRS+=	ppi
234SE_PPI= \
235	Makefile \
236	ppilcd.c
237
238SE_DIRS+=	ppp
239SE_PPP= \
240	chap-auth \
241	login-auth \
242	ppp.conf.sample \
243	ppp.conf.span-isp \
244	ppp.conf.span-isp.working \
245	ppp.linkdown.sample \
246	ppp.linkdown.span-isp \
247	ppp.linkdown.span-isp.working \
248	ppp.linkup.sample \
249	ppp.linkup.span-isp \
250	ppp.linkup.span-isp.working \
251	ppp.secret.sample \
252	ppp.secret.span-isp \
253	ppp.secret.span-isp.working
254
255SE_DIRS+=	printing
256SE_PRINTING= \
257	diablo-if-net \
258	hpdf \
259	hpif \
260	hpof \
261	hprf \
262	hpvf \
263	if-simple \
264	if-simpleX \
265	ifhp \
266	make-ps-header \
267	netprint \
268	psdf \
269	psdfX \
270	psif \
271	pstf \
272	pstfX
273
274SE_DIRS+=	ses
275SE_SES= \
276	Makefile \
277	Makefile.inc
278
279SE_DIRS+=	ses/getencstat
280SE_SES_GETENCSTAT= \
281	Makefile \
282	getencstat.0
283
284SE_DIRS+=	ses/sesd
285SE_SES_SESD= \
286	Makefile \
287	sesd.0
288
289SE_DIRS+=	ses/setencstat
290SE_SES_SETENCSTAT= \
291	Makefile \
292	setencstat.0
293
294SE_DIRS+=	ses/setobjstat
295SE_SES_SETOBJSTAT= \
296	Makefile \
297	setobjstat.0
298
299SE_DIRS+=	ses/srcs
300SE_SES_SRCS= \
301	chpmon.c \
302	eltsub.c \
303	eltsub.h \
304	getencstat.c \
305	getnobj.c \
306	getobjmap.c \
307	getobjstat.c \
308	inienc.c \
309	sesd.c \
310	setencstat.c \
311	setobjstat.c
312
313SE_DIRS+=	scsi_target
314SE_SCSI_TARGET= \
315	Makefile \
316	scsi_target.c \
317	scsi_target.h \
318	scsi_target.8 \
319	scsi_cmds.c
320
321SE_DIRS+=	sound
322SE_SOUND= \
323	basic.c \
324	ossinit.h \
325	ossmidi.h \
326	midi.c \
327	README
328
329SE_DIRS+=	sunrpc
330SE_SUNRPC=	Makefile
331
332SE_DIRS+=	sunrpc/dir
333SE_SUNRPC_DIR= \
334	Makefile \
335	dir.x \
336	dir_proc.c \
337	rls.c
338
339SE_DIRS+=	sunrpc/msg
340SE_SUNRPC_MSG= \
341	Makefile \
342	msg.x \
343	msg_proc.c \
344	printmsg.c \
345	rprintmsg.c
346
347SE_DIRS+=	sunrpc/sort
348SE_SUNRPC_SORT= \
349	Makefile \
350	rsort.c \
351	sort.x \
352	sort_proc.c
353
354.if ${MK_EFI} != "no"
355LDIRS+=		uefisign
356SE_DIRS+=	uefisign
357SE_UEFISIGN=	uefikeys
358.endif
359
360SE_DIRS+=	ypldap
361SE_YPLDAP=	ypldap.conf
362
363.if ${MK_HAST} != "no"
364LDIRS+=		hast
365SE_DIRS+=	hast
366SE_HAST=	ucarp.sh \
367	ucarp_down.sh \
368	ucarp_up.sh \
369	vip-down.sh \
370	vip-up.sh
371.endif
372
373.if ${MK_USB} != "no"
374LDIRS+=		libusb20
375SE_DIRS+=	libusb20
376SE_LIBUSB20= \
377	Makefile \
378	README \
379	util.c \
380	util.h \
381	bulk.c \
382	control.c
383.endif
384
385
386# Setup the FILES_GROUPS for all DIRS variables above.
387# The variables are prefixed by 'SE_' to prevent variable collision in
388# other parts of the system
389.for d in ${SE_DIRS}
390.for f in ${SE_${d:tu:C/\//_/g}}
391SER_${d:tu:C/\//_/g}+=	${d}/${f}
392.endfor
393FILESGROUPS+=	SER_${d:tu:C/\//_/g}
394SER_${d:tu:C/\//_/g}DIR+=	${SHAREDIR}/examples/${d}
395.endfor
396
397BINDIR= ${SHAREDIR}/examples
398
399beforeinstall: copies
400META_TARGETS+=	copies
401
402copies:
403.for i in ${LDIRS}
404	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
405		rm -f ${DESTDIR}${BINDIR}/$i; \
406	fi
407.endfor
408
409SUBDIR+=	smbfs
410
411HAS_TESTS=
412SUBDIR.${MK_TESTS}+= tests
413
414SUBDIR_PARALLEL=
415
416.include <bsd.prog.mk>
417