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