xref: /freebsd/share/examples/Makefile (revision 70ae0c4524d2c5d0aae3339e95f6bd4f3c480b6e)
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	etc \
14	find_interface \
15	flua \
16	indent \
17	inotify \
18	ipfw \
19	jails \
20	kld \
21	libvgl \
22	mdoc \
23	netgraph \
24	oci \
25	ppi \
26	ppp \
27	ses \
28	scsi_target \
29	sound \
30	sunrpc \
31	ypldap
32
33
34SE_DIRS+=	BSD_daemon
35SE_BSD_DAEMON= \
36	FreeBSD.pfa \
37	README \
38	beastie.eps \
39	beastie.fig \
40	eps.patch \
41	poster.sh
42
43.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
44.if ${MK_BHYVE} != "no"
45LDIRS+=		bhyve
46SE_DIRS+=	bhyve
47SE_BHYVEPACKAGE=bhyve
48SE_BHYVE=	vmrun.sh
49PACKAGE_bhyve/vmrun.sh=	bhyve
50.endif
51.endif
52
53SE_DIRS+=	FreeBSD_version
54SE_FREEBSD_VERSION= \
55	FreeBSD_version.c \
56	Makefile \
57	README
58
59SE_DIRS+=	bootforth
60SE_BOOTFORTH_PACKAGE=bootloader
61SE_BOOTFORTH= \
62	README \
63	boot.4th \
64	frames.4th \
65	loader.rc \
66	menu.4th \
67	menuconf.4th \
68	screen.4th
69
70SE_DIRS+=	csh
71SE_CSHPACKAGE=	csh
72SE_CSH=		dot.cshrc
73
74SE_DIRS+=	etc
75SE_ETC= \
76	README.examples \
77	bsd-style-copyright \
78	make.conf
79
80SE_DIRS+=	find_interface
81SE_FIND_INTERFACE= \
82	Makefile \
83	README \
84	find_interface.c
85
86SE_DIRS+=	flua
87SE_FLUA=	libjail.lua
88
89SE_DIRS+=	indent
90SE_INDENT=	indent.pro
91
92SE_DIRS+=	inotify
93SE_INOTIFY=	inotify.c \
94		Makefile
95
96.if ${MK_IPFILTER} != "no"
97SUBDIR+=	ipfilter
98.endif
99
100SE_DIRS+=	ipfw
101SE_IPFWPACKAGE=	ipfw
102SE_IPFW=	change_rules.sh
103
104SE_DIRS+=	jails
105SE_JAILPACKAGE=	jail
106SE_JAILS= \
107	README \
108	VIMAGE \
109	jail.xxx.conf \
110	jib \
111	jng \
112	rc.conf.jails \
113	rcjail.xxx.conf
114
115SE_DIRS+=	kld
116SE_KLD=	Makefile
117
118SE_DIRS+=	kld/cdev
119SE_KLD_CDEV= \
120	Makefile \
121	README \
122
123SE_DIRS+=	kld/cdev/module
124SE_KLD_CDEV_MODULE= \
125	Makefile \
126	cdev.c \
127	cdev.h \
128	cdevmod.c
129
130SE_DIRS+=	kld/cdev/test
131SE_KLD_CDEV_TEST= \
132	Makefile \
133	testcdev.c
134
135SE_DIRS+=	kld/dyn_sysctl
136SE_KLD_DYN_SYSCTL= \
137	Makefile \
138	README \
139	dyn_sysctl.c
140
141SE_DIRS+=	kld/firmware
142SE_KLD_FIRMWARE= \
143	Makefile \
144	README
145
146SE_DIRS+=	kld/firmware/fwconsumer
147SE_KLD_FIRMWARE_FWCONSUMER= \
148	Makefile \
149	fw_consumer.c
150
151SE_DIRS+=	kld/firmware/fwimage
152SE_KLD_FIRMWARE_FWIMAGE= \
153	Makefile \
154	firmware.img.uu
155
156SE_DIRS+=	kld/khelp
157SE_KLD_KHELP= \
158	Makefile \
159	README \
160	h_example.c
161
162SE_DIRS+=	kld/syscall
163SE_KLD_SYSCALL=	Makefile
164
165SE_DIRS+=	kld/syscall/module
166SE_KLD_SYSCALL_MODULE= \
167	Makefile \
168	syscall.c
169
170SE_DIRS+=	kld/syscall/test
171SE_KLD_SYSCALL_TEST= \
172	Makefile \
173	call.c
174
175SE_DIRS+=	libvgl
176SE_LIBVGL=	\
177	Makefile \
178	demo.c
179
180SE_DIRS+=	mdoc
181SE_MDOC= \
182	POSIX-copyright \
183	deshallify.sh \
184	example.1 \
185	example.3 \
186	example.4 \
187	example.9
188
189SE_DIRS+=	netgraph
190SE_NETGRAPH= \
191	ether.bridge \
192	frame_relay \
193	ngctl \
194	raw \
195	udp.tunnel \
196	virtual.chain \
197	virtual.lan \
198
199SE_DIRS+=	oci
200SE_OCI= \
201	README \
202	Containerfile.pkg
203
204.if ${MK_PF} != "no"
205SE_DIRS+=	pf
206.if ${MK_STAGING} == "no"
207SE_PFPACKAGE=	pf
208SE_PF= \
209	ackpri \
210	faq-example1 \
211	faq-example2 \
212	faq-example3 \
213	pf.conf \
214	queue1 \
215	queue2 \
216	queue3 \
217	queue4 \
218	spamd
219.endif
220.endif
221
222SE_DIRS+=	ppi
223SE_PPI= \
224	Makefile \
225	ppilcd.c
226
227SE_DIRS+=	ppp
228SE_PPPPACKAGE=	ppp
229SE_PPP= \
230	chap-auth \
231	login-auth \
232	ppp.conf.sample \
233	ppp.conf.span-isp \
234	ppp.conf.span-isp.working \
235	ppp.linkdown.sample \
236	ppp.linkdown.span-isp \
237	ppp.linkdown.span-isp.working \
238	ppp.linkup.sample \
239	ppp.linkup.span-isp \
240	ppp.linkup.span-isp.working \
241	ppp.secret.sample \
242	ppp.secret.span-isp \
243	ppp.secret.span-isp.working
244
245.if ${MK_LPR} != "no"
246LDIRS+=		printing
247SE_DIRS+=	printing
248SE_PRINTINGPACKAGE=lp
249SE_PRINTING= \
250	diablo-if-net \
251	hpdf \
252	hpif \
253	hpof \
254	hprf \
255	hpvf \
256	if-simple \
257	if-simpleX \
258	ifhp \
259	make-ps-header \
260	netprint \
261	psdf \
262	psdfX \
263	psif \
264	pstf \
265	pstfX
266.endif
267
268SE_DIRS+=	ses
269SE_SES= \
270	Makefile \
271	Makefile.inc
272
273SE_DIRS+=	ses/getencstat
274SE_SES_GETENCSTAT= \
275	Makefile \
276	getencstat.0
277
278SE_DIRS+=	ses/sesd
279SE_SES_SESD= \
280	Makefile \
281	sesd.0
282
283SE_DIRS+=	ses/setencstat
284SE_SES_SETENCSTAT= \
285	Makefile \
286	setencstat.0
287
288SE_DIRS+=	ses/setobjstat
289SE_SES_SETOBJSTAT= \
290	Makefile \
291	setobjstat.0
292
293SE_DIRS+=	ses/srcs
294SE_SES_SRCS= \
295	chpmon.c \
296	eltsub.c \
297	eltsub.h \
298	getencstat.c \
299	getnobj.c \
300	getobjmap.c \
301	getobjstat.c \
302	inienc.c \
303	sesd.c \
304	setencstat.c \
305	setobjstat.c
306
307SE_DIRS+=	scsi_target
308SE_SCSI_TARGET= \
309	Makefile \
310	scsi_target.c \
311	scsi_target.h \
312	scsi_target.8 \
313	scsi_cmds.c
314
315SE_DIRS+=	sound
316SE_SOUND= \
317	kqueue.c \
318	midi.c \
319	mmap.c \
320	oss.h \
321	poll.c \
322	select.c \
323	simple.c \
324	sndstat_nv.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