xref: /freebsd-14.2/share/examples/Makefile (revision 8a688fcc)
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	IPv6 \
12	bootforth \
13	csh \
14	drivers \
15	etc \
16	find_interface \
17	flua \
18	indent \
19	ipfw \
20	jails \
21	kld \
22	libvgl \
23	mdoc \
24	netgraph \
25	oci \
26	perfmon \
27	ppi \
28	ppp \
29	printing \
30	ses \
31	scsi_target \
32	sound \
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+=	drivers
78SE_DRIVERS= \
79	README \
80	make_device_driver.sh \
81	make_pseudo_driver.sh
82
83SE_DIRS+=	etc
84SE_ETC= \
85	README.examples \
86	bsd-style-copyright \
87	make.conf
88
89SE_DIRS+=	find_interface
90SE_FIND_INTERFACE= \
91	Makefile \
92	README \
93	find_interface.c
94
95SE_DIRS+=	flua
96SE_FLUA=	libjail.lua
97
98SE_DIRS+=	indent
99SE_INDENT=	indent.pro
100
101.if ${MK_IPFILTER} != "no"
102SUBDIR+=	ipfilter
103.endif
104
105SE_DIRS+=	ipfw
106SE_IPFW=	change_rules.sh
107
108SE_DIRS+=	jails
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+=	oci
203SE_OCI= \
204	README \
205	Containerfile.pkg
206
207SE_DIRS+=	perfmon
208SE_PERFMON= \
209	Makefile \
210	README \
211	perfmon.c \
212
213.if ${MK_PF} != "no"
214SE_DIRS+=	pf
215.if ${MK_STAGING} == "no"
216SE_PF= \
217	ackpri \
218	faq-example1 \
219	faq-example2 \
220	faq-example3 \
221	pf.conf \
222	queue1 \
223	queue2 \
224	queue3 \
225	queue4 \
226	spamd
227.endif
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+=	sound
319SE_SOUND= \
320	  sndstat_nv.c \
321	  midi.c
322
323SE_DIRS+=	sound/oss
324SE_SOUND_OSS= \
325	README \
326	audio.c
327
328SE_DIRS+=	sunrpc
329SE_SUNRPC=	Makefile
330
331SE_DIRS+=	sunrpc/dir
332SE_SUNRPC_DIR= \
333	Makefile \
334	dir.x \
335	dir_proc.c \
336	rls.c
337
338SE_DIRS+=	sunrpc/msg
339SE_SUNRPC_MSG= \
340	Makefile \
341	msg.x \
342	msg_proc.c \
343	printmsg.c \
344	rprintmsg.c
345
346SE_DIRS+=	sunrpc/sort
347SE_SUNRPC_SORT= \
348	Makefile \
349	rsort.c \
350	sort.x \
351	sort_proc.c
352
353.if ${MK_EFI} != "no"
354LDIRS+=		uefisign
355SE_DIRS+=	uefisign
356SE_UEFISIGN=	uefikeys
357.endif
358
359SE_DIRS+=	ypldap
360SE_YPLDAP=	ypldap.conf
361
362.if ${MK_HAST} != "no"
363LDIRS+=		hast
364SE_DIRS+=	hast
365SE_HAST=	ucarp.sh \
366	ucarp_down.sh \
367	ucarp_up.sh \
368	vip-down.sh \
369	vip-up.sh
370.endif
371
372.if ${MK_USB} != "no"
373LDIRS+=		libusb20
374SE_DIRS+=	libusb20
375SE_LIBUSB20= \
376	Makefile \
377	README \
378	util.c \
379	util.h \
380	bulk.c \
381	control.c
382.endif
383
384
385# Setup the FILES_GROUPS for all DIRS variables above.
386# The variables are prefixed by 'SE_' to prevent variable collision in
387# other parts of the system
388.for d in ${SE_DIRS}
389.for f in ${SE_${d:tu:C/\//_/g}}
390SER_${d:tu:C/\//_/g}+=	${d}/${f}
391.endfor
392FILESGROUPS+=	SER_${d:tu:C/\//_/g}
393SER_${d:tu:C/\//_/g}DIR+=	${SHAREDIR}/examples/${d}
394.endfor
395
396BINDIR= ${SHAREDIR}/examples
397
398beforeinstall: copies
399META_TARGETS+=	copies
400
401copies:
402.for i in ${LDIRS}
403	if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
404		rm -f ${DESTDIR}${BINDIR}/$i; \
405	fi
406.endfor
407
408SUBDIR+=	smbfs
409
410HAS_TESTS=
411SUBDIR.${MK_TESTS}+= tests
412
413SUBDIR_PARALLEL=
414
415.include <bsd.prog.mk>
416