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