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