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