xref: /freebsd/share/examples/Makefile (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
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	diskless \
15	drivers \
16	etc \
17	find_interface \
18	flua \
19	indent \
20	ipfw \
21	jails \
22	kld \
23	libvgl \
24	mdoc \
25	netgraph \
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+=	diskless
78SE_DISKLESS= \
79	ME \
80	README.BOOTP \
81	README.TEMPLATING \
82	clone_root
83
84SE_DIRS+=	drivers
85SE_DRIVERS= \
86	README \
87	make_device_driver.sh \
88	make_pseudo_driver.sh
89
90SE_DIRS+=	etc
91SE_ETC= \
92	README.examples \
93	bsd-style-copyright \
94	make.conf
95
96SE_DIRS+=	find_interface
97SE_FIND_INTERFACE= \
98	Makefile \
99	README \
100	find_interface.c
101
102SE_DIRS+=	flua
103SE_FLUA=	libjail.lua
104
105SE_DIRS+=	indent
106SE_INDENT=	indent.pro
107
108.if ${MK_IPFILTER} != "no"
109SUBDIR+=	ipfilter
110.endif
111
112SE_DIRS+=	ipfw
113SE_IPFW=	change_rules.sh
114
115SE_DIRS+=	jails
116SE_JAILS= \
117	README \
118	VIMAGE \
119	jail.xxx.conf \
120	jib \
121	jng \
122	rc.conf.jails \
123	rcjail.xxx.conf
124
125SE_DIRS+=	kld
126SE_KLD=	Makefile
127
128SE_DIRS+=	kld/cdev
129SE_KLD_CDEV= \
130	Makefile \
131	README \
132
133SE_DIRS+=	kld/cdev/module
134SE_KLD_CDEV_MODULE= \
135	Makefile \
136	cdev.c \
137	cdev.h \
138	cdevmod.c
139
140SE_DIRS+=	kld/cdev/test
141SE_KLD_CDEV_TEST= \
142	Makefile \
143	testcdev.c
144
145SE_DIRS+=	kld/dyn_sysctl
146SE_KLD_DYN_SYSCTL= \
147	Makefile \
148	README \
149	dyn_sysctl.c
150
151SE_DIRS+=	kld/firmware
152SE_KLD_FIRMWARE= \
153	Makefile \
154	README
155
156SE_DIRS+=	kld/firmware/fwconsumer
157SE_KLD_FIRMWARE_FWCONSUMER= \
158	Makefile \
159	fw_consumer.c
160
161SE_DIRS+=	kld/firmware/fwimage
162SE_KLD_FIRMWARE_FWIMAGE= \
163	Makefile \
164	firmware.img.uu
165
166SE_DIRS+=	kld/khelp
167SE_KLD_KHELP= \
168	Makefile \
169	README \
170	h_example.c
171
172SE_DIRS+=	kld/syscall
173SE_KLD_SYSCALL=	Makefile
174
175SE_DIRS+=	kld/syscall/module
176SE_KLD_SYSCALL_MODULE= \
177	Makefile \
178	syscall.c
179
180SE_DIRS+=	kld/syscall/test
181SE_KLD_SYSCALL_TEST= \
182	Makefile \
183	call.c
184
185SE_DIRS+=	libvgl
186SE_LIBVGL=	\
187	Makefile \
188	demo.c
189
190SE_DIRS+=	mdoc
191SE_MDOC= \
192	POSIX-copyright \
193	deshallify.sh \
194	example.1 \
195	example.3 \
196	example.4 \
197	example.9
198
199SE_DIRS+=	netgraph
200SE_NETGRAPH= \
201	ether.bridge \
202	frame_relay \
203	ngctl \
204	raw \
205	udp.tunnel \
206	virtual.chain \
207	virtual.lan \
208
209SE_DIRS+=	perfmon
210SE_PERFMON= \
211	Makefile \
212	README \
213	perfmon.c \
214
215.if ${MK_PF} != "no"
216SE_DIRS+=	pf
217.if ${MK_STAGING} == "no"
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_PPP= \
239	chap-auth \
240	login-auth \
241	ppp.conf.sample \
242	ppp.conf.span-isp \
243	ppp.conf.span-isp.working \
244	ppp.linkdown.sample \
245	ppp.linkdown.span-isp \
246	ppp.linkdown.span-isp.working \
247	ppp.linkup.sample \
248	ppp.linkup.span-isp \
249	ppp.linkup.span-isp.working \
250	ppp.secret.sample \
251	ppp.secret.span-isp \
252	ppp.secret.span-isp.working
253
254SE_DIRS+=	printing
255SE_PRINTING= \
256	diablo-if-net \
257	hpdf \
258	hpif \
259	hpof \
260	hprf \
261	hpvf \
262	if-simple \
263	if-simpleX \
264	ifhp \
265	make-ps-header \
266	netprint \
267	psdf \
268	psdfX \
269	psif \
270	pstf \
271	pstfX
272
273SE_DIRS+=	ses
274SE_SES= \
275	Makefile \
276	Makefile.inc
277
278SE_DIRS+=	ses/getencstat
279SE_SES_GETENCSTAT= \
280	Makefile \
281	getencstat.0
282
283SE_DIRS+=	ses/sesd
284SE_SES_SESD= \
285	Makefile \
286	sesd.0
287
288SE_DIRS+=	ses/setencstat
289SE_SES_SETENCSTAT= \
290	Makefile \
291	setencstat.0
292
293SE_DIRS+=	ses/setobjstat
294SE_SES_SETOBJSTAT= \
295	Makefile \
296	setobjstat.0
297
298SE_DIRS+=	ses/srcs
299SE_SES_SRCS= \
300	chpmon.c \
301	eltsub.c \
302	eltsub.h \
303	getencstat.c \
304	getnobj.c \
305	getobjmap.c \
306	getobjstat.c \
307	inienc.c \
308	sesd.c \
309	setencstat.c \
310	setobjstat.c
311
312SE_DIRS+=	scsi_target
313SE_SCSI_TARGET= \
314	Makefile \
315	scsi_target.c \
316	scsi_target.h \
317	scsi_target.8 \
318	scsi_cmds.c
319
320SE_DIRS+=	sound
321SE_SOUND= \
322	basic.c \
323	ossinit.h \
324	ossmidi.h \
325	midi.c \
326	README
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