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