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