xref: /freebsd/lib/libc/gen/Makefile.inc (revision ffd294a1f4c23863c3e515d16dce31d5509bcb01)
1# machine-independent gen sources
2.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen ${SRCTOP}/etc
3
4CONFS+=	group master.passwd shells
5CONFSMODE_master.passwd=	600
6CONFSPACKAGE=   runtime
7
8SRCS+= \
9	__pthread_mutex_init_calloc_cb_stub.c \
10	__xuname.c \
11	_once_stub.c \
12	_pthread_stubs.c \
13	_rand48.c \
14	_spinlock_stub.c \
15	_thread_init.c \
16	aio_read2.c \
17	aio_write2.c \
18	alarm.c \
19	arc4random.c \
20	arc4random-compat.c \
21	arc4random_uniform.c \
22	assert.c \
23	basename.c \
24	basename_compat.c \
25	cap_sandboxed.c \
26	check_utility_compat.c \
27	clock.c \
28	clock_getcpuclockid.c \
29	closedir.c \
30	confstr.c \
31	cpuset_alloc.c \
32	cpuset_free.c \
33	crypt.c \
34	ctermid.c \
35	daemon.c \
36	devname.c \
37	devname-compat11.c \
38	dirfd.c \
39	dirname.c \
40	dirname_compat.c \
41	disklabel.c \
42	dlfcn.c \
43	drand48.c \
44	dup3.c \
45	elf_utils.c \
46	erand48.c \
47	err.c \
48	errlst.c \
49	eventfd.c \
50	exec.c \
51	exect.c \
52	fdevname.c \
53	feature_present.c \
54	fmtcheck.c \
55	fmtmsg.c \
56	fnmatch.c \
57	fpclassify.c \
58	frexp.c \
59	fstab.c \
60	ftok.c \
61	fts.c \
62	fts-compat.c \
63	fts-compat11.c \
64	ftw.c \
65	ftw-compat11.c \
66	getbootfile.c \
67	getbsize.c \
68	getcap.c \
69	getcwd.c \
70	getdomainname.c \
71	getentropy.c \
72	getgrent.c \
73	getgrouplist.c \
74	gethostname.c \
75	getloadavg.c \
76	getlogin.c \
77	getmntinfo.c \
78	getmntinfo-compat11.c \
79	getnetgrent.c \
80	getosreldate.c \
81	getpeereid.c \
82	getprogname.c \
83	getpwent.c \
84	getttyent.c \
85	getusershell.c \
86	getutxent.c \
87	getvfsbyname.c \
88	glob.c \
89	glob-compat11.c \
90	initgroups.c \
91	isatty.c \
92	isinf.c \
93	isnan.c \
94	jrand48.c \
95	kqueue1.c \
96	lcong48.c \
97	libc_dlopen.c \
98	libc_interposing_table.c  \
99	lrand48.c \
100	memalign.c \
101	memfd_create.c \
102	mrand48.c \
103	nftw.c \
104	nftw-compat11.c \
105	nice.c \
106	nlist.c \
107	nrand48.c \
108	opendir.c \
109	pause.c \
110	pmadvise.c \
111	popen.c \
112	posix_spawn.c \
113	psignal.c \
114	pututxline.c \
115	pw_scan.c \
116	raise.c \
117	readdir.c \
118	readdir-compat11.c \
119	readpassphrase.c \
120	rewinddir.c \
121	scandir.c \
122	scandir_b.c \
123	scandir-compat11.c \
124	sched_getaffinity.c \
125	sched_setaffinity.c \
126	seed48.c \
127	seekdir.c \
128	semctl.c \
129	setdomainname.c \
130	sethostname.c \
131	setjmperr.c \
132	setmode.c \
133	setproctitle.c \
134	setprogname.c \
135	siginterrupt.c \
136	siglist.c \
137	signal.c \
138	sigsetops.c \
139	sleep.c \
140	srand48.c \
141	statvfs.c \
142	stringlist.c \
143	strtofflags.c \
144	sysconf.c \
145	sysctl.c \
146	sysctlbyname.c \
147	sysctlnametomib.c \
148	syslog.c \
149	telldir.c \
150	termios.c \
151	time.c \
152	times.c \
153	timespec_get.c \
154	timespec_getres.c \
155	timezone.c \
156	tls.c \
157	ttyname.c \
158	ttyslot.c \
159	ualarm.c \
160	ulimit.c \
161	uname.c \
162	unvis-compat.c \
163	usleep.c \
164	utime.c \
165	utxdb.c \
166	valloc.c \
167	wordexp.c
168
169CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20
170
171CFLAGS.sysconf.c= -I${SRCTOP}/contrib/tzcode
172
173CFLAGS.dlfcn.c= ${RTLD_HDRS}
174CFLAGS.tls.c= ${RTLD_HDRS}
175
176.PATH: ${SRCTOP}/contrib/libc-pwcache
177SRCS+=	pwcache.c pwcache.h
178
179.PATH: ${SRCTOP}/contrib/libc-vis
180CFLAGS+=	-I${SRCTOP}/contrib/libc-vis
181SRCS+=	unvis.c vis.c
182
183MISRCS+=modf.c
184
185CANCELPOINTS_SRCS=sem.c sem_new.c
186.for src in ${CANCELPOINTS_SRCS}
187SRCS+=cancelpoints_${src}
188CLEANFILES+=cancelpoints_${src}
189cancelpoints_${src}: ${LIBC_SRCTOP}/gen/${src} .NOMETA
190	ln -sf ${.ALLSRC} ${.TARGET}
191.endfor
192
193SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map
194
195# machine-dependent gen sources
196.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/gen/Makefile.inc"
197
198MAN+=	alarm.3 \
199	arc4random.3 \
200	basename.3 \
201	cap_rights_get.3 \
202	cap_sandboxed.3 \
203	check_utility_compat.3 \
204	clock.3 \
205	clock_getcpuclockid.3 \
206	confstr.3 \
207	ctermid.3 \
208	daemon.3 \
209	devname.3 \
210	directory.3 \
211	dirname.3 \
212	dl_iterate_phdr.3 \
213	dladdr.3 \
214	dlinfo.3 \
215	dllockinit.3 \
216	dlopen.3 \
217	dup3.3 \
218	err.3 \
219	exec.3 \
220	feature_present.3 \
221	fmtcheck.3 \
222	fmtmsg.3 \
223	fnmatch.3 \
224	fpclassify.3 \
225	frexp.3 \
226	ftok.3 \
227	fts.3 \
228	ftw.3 \
229	getbootfile.3 \
230	getbsize.3 \
231	getcap.3 \
232	getcontext.3 \
233	getcwd.3 \
234	getdiskbyname.3 \
235	getdomainname.3 \
236	getentropy.3 \
237	getfsent.3 \
238	getgrent.3 \
239	getgrouplist.3 \
240	gethostname.3 \
241	getloadavg.3 \
242	getmntinfo.3 \
243	getnetgrent.3 \
244	getosreldate.3 \
245	getpass.3 \
246	getpeereid.3 \
247	getprogname.3 \
248	getpwent.3 \
249	getttyent.3 \
250	getusershell.3 \
251	getutxent.3 \
252	getvfsbyname.3 \
253	glob.3 \
254	initgroups.3 \
255	isgreater.3 \
256	ldexp.3 \
257	makecontext.3 \
258	modf.3 \
259	nice.3 \
260	nlist.3 \
261	pause.3 \
262	popen.3 \
263	posix_spawn.3 \
264	posix_spawn_file_actions_addopen.3 \
265	posix_spawn_file_actions_init.3 \
266	posix_spawnattr_getflags.3 \
267	posix_spawnattr_getpgroup.3 \
268	posix_spawnattr_getschedparam.3 \
269	posix_spawnattr_getschedpolicy.3 \
270	posix_spawnattr_init.3 \
271	posix_spawnattr_getsigdefault.3 \
272	posix_spawnattr_getsigmask.3 \
273	psignal.3 \
274	pwcache.3 \
275	raise.3 \
276	rand48.3 \
277	readpassphrase.3 \
278	scandir.3 \
279	sem_destroy.3 \
280	sem_getvalue.3 \
281	sem_init.3 \
282	sem_open.3 \
283	sem_post.3 \
284	sem_timedwait.3 \
285	sem_wait.3 \
286	setjmp.3 \
287	setmode.3 \
288	setproctitle.3 \
289	siginterrupt.3 \
290	signal.3 \
291	sigsetops.3 \
292	statvfs.3 \
293	stringlist.3 \
294	strtofflags.3 \
295	sysconf.3 \
296	sysctl.3 \
297	syslog.3 \
298	tcgetpgrp.3 \
299	tcgetsid.3 \
300	tcgetwinsize.3 \
301	tcsendbreak.3 \
302	tcsetattr.3 \
303	tcsetpgrp.3 \
304	tcsetsid.3 \
305	time.3 \
306	times.3 \
307	timespec_get.3 \
308	timespec_getres.3 \
309	ttyname.3 \
310	ualarm.3 \
311	ucontext.3 \
312	ulimit.3 \
313	uname.3 \
314	unvis.3 \
315	utime.3 \
316	valloc.3 \
317	vis.3 \
318	wordexp.3
319
320MLINKS+=arc4random.3 arc4random_buf.3 \
321	arc4random.3 arc4random_uniform.3
322MLINKS+=ctermid.3 ctermid_r.3
323MLINKS+=daemon.3 daemonfd.3
324MLINKS+=devname.3 devname_r.3
325MLINKS+=devname.3 fdevname.3
326MLINKS+=devname.3 fdevname_r.3
327MLINKS+=directory.3 closedir.3 \
328	directory.3 dirfd.3 \
329	directory.3 fdclosedir.3 \
330	directory.3 fdopendir.3 \
331	directory.3 opendir.3 \
332	directory.3 readdir.3 \
333	directory.3 readdir_r.3 \
334	directory.3 rewinddir.3 \
335	directory.3 seekdir.3 \
336	directory.3 telldir.3
337MLINKS+=dlopen.3 fdlopen.3 \
338	dlopen.3 dlclose.3 \
339	dlopen.3 dlerror.3 \
340	dlopen.3 dlfunc.3 \
341	dlopen.3 dlsym.3 \
342	dlopen.3 dlvsym.3
343MLINKS+=err.3 err_set_exit.3 \
344	err.3 err_set_file.3 \
345	err.3 errc.3 \
346	err.3 errx.3 \
347	err.3 verr.3 \
348	err.3 verrc.3 \
349	err.3 verrx.3 \
350	err.3 vwarn.3 \
351	err.3 vwarnc.3 \
352	err.3 vwarnx.3 \
353	err.3 warnc.3 \
354	err.3 warn.3 \
355	err.3 warnx.3
356MLINKS+=exec.3 execl.3 \
357	exec.3 execle.3 \
358	exec.3 execlp.3 \
359	exec.3 exect.3 \
360	exec.3 execv.3 \
361	exec.3 execvP.3 \
362	exec.3 execvp.3
363MLINKS+=fpclassify.3 finite.3 \
364	fpclassify.3 finitef.3 \
365	fpclassify.3 isfinite.3 \
366	fpclassify.3 isinf.3 \
367	fpclassify.3 isnan.3 \
368	fpclassify.3 isnormal.3
369MLINKS+=frexp.3 frexpf.3 \
370	frexp.3 frexpl.3
371MLINKS+=fts.3 fts_children.3 \
372	fts.3 fts_close.3 \
373	fts.3 fts_open.3 \
374	fts.3 fts_read.3 \
375	fts.3 fts_set.3 \
376	fts.3 fts_set_clientptr.3 \
377	fts.3 fts_get_clientptr.3 \
378	fts.3 fts_get_stream.3
379MLINKS+=ftw.3 nftw.3
380MLINKS+=getcap.3 cgetcap.3 \
381	getcap.3 cgetclose.3 \
382	getcap.3 cgetent.3 \
383	getcap.3 cgetfirst.3 \
384	getcap.3 cgetmatch.3 \
385	getcap.3 cgetnext.3 \
386	getcap.3 cgetnum.3 \
387	getcap.3 cgetset.3 \
388	getcap.3 cgetstr.3 \
389	getcap.3 cgetustr.3
390MLINKS+=getcwd.3 getwd.3
391MLINKS+=getcontext.3 getcontextx.3
392MLINKS+=getcontext.3 setcontext.3
393MLINKS+=getdomainname.3 setdomainname.3
394MLINKS+=getfsent.3 endfsent.3 \
395	getfsent.3 getfsfile.3 \
396	getfsent.3 getfsspec.3 \
397	getfsent.3 getfstype.3 \
398	getfsent.3 setfsent.3 \
399	getfsent.3 setfstab.3 \
400	getfsent.3 getfstab.3
401MLINKS+=getgrent.3 endgrent.3 \
402	getgrent.3 getgrgid.3 \
403	getgrent.3 getgrnam.3 \
404	getgrent.3 setgrent.3 \
405	getgrent.3 setgroupent.3 \
406	getgrent.3 getgrent_r.3 \
407	getgrent.3 getgrnam_r.3 \
408	getgrent.3 getgrgid_r.3
409MLINKS+=gethostname.3 sethostname.3
410MLINKS+=getnetgrent.3 endnetgrent.3 \
411	getnetgrent.3 getnetgrent_r.3 \
412	getnetgrent.3 innetgr.3 \
413	getnetgrent.3 setnetgrent.3
414MLINKS+=getprogname.3 setprogname.3
415MLINKS+=getpwent.3 endpwent.3 \
416	getpwent.3 getpwnam.3 \
417	getpwent.3 getpwuid.3 \
418	getpwent.3 setpassent.3 \
419	getpwent.3 setpwent.3 \
420	getpwent.3 setpwfile.3 \
421	getpwent.3 getpwent_r.3 \
422	getpwent.3 getpwnam_r.3 \
423	getpwent.3 getpwuid_r.3
424MLINKS+=getttyent.3 endttyent.3 \
425	getttyent.3 getttynam.3 \
426	getttyent.3 isdialuptty.3 \
427	getttyent.3 isnettty.3 \
428	getttyent.3 setttyent.3
429MLINKS+=getusershell.3 endusershell.3 \
430	getusershell.3 setusershell.3
431MLINKS+=getutxent.3 endutxent.3 \
432	getutxent.3 getutxid.3 \
433	getutxent.3 getutxline.3 \
434	getutxent.3 getutxuser.3 \
435	getutxent.3 pututxline.3 \
436	getutxent.3 setutxdb.3 \
437	getutxent.3 setutxent.3 \
438	getutxent.3 utmpx.3
439MLINKS+=glob.3 globfree.3
440MLINKS+=isgreater.3 isgreaterequal.3 \
441	isgreater.3 isless.3 \
442	isgreater.3 islessequal.3 \
443	isgreater.3 islessgreater.3 \
444	isgreater.3 isunordered.3
445MLINKS+=ldexp.3 ldexpf.3 \
446	ldexp.3 ldexpl.3
447MLINKS+=makecontext.3 swapcontext.3
448MLINKS+=modf.3 modff.3 \
449	modf.3 modfl.3
450MLINKS+=popen.3 pclose.3
451MLINKS+=posix_spawn.3 posix_spawnp.3 \
452	posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \
453	posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclosefrom_np.3 \
454	posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_adddup2.3 \
455	posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addchdir_np.3 \
456	posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addfchdir_np.3 \
457	posix_spawn_file_actions_init.3 posix_spawn_file_actions_destroy.3 \
458	posix_spawnattr_getflags.3 posix_spawnattr_setflags.3 \
459	posix_spawnattr_getpgroup.3 posix_spawnattr_setpgroup.3 \
460	posix_spawnattr_getschedparam.3 posix_spawnattr_setschedparam.3 \
461	posix_spawnattr_getschedpolicy.3 posix_spawnattr_setschedpolicy.3 \
462	posix_spawnattr_getsigdefault.3 posix_spawnattr_setsigdefault.3 \
463	posix_spawnattr_getsigmask.3 posix_spawnattr_setsigmask.3 \
464	posix_spawnattr_init.3 posix_spawnattr_destroy.3
465MLINKS+=psignal.3 strsignal.3 \
466	psignal.3 sys_siglist.3 \
467	psignal.3 sys_signame.3
468MLINKS+=pwcache.3 gid_from_group.3 \
469	pwcache.3 group_from_gid.3 \
470	pwcache.3 pwcache_groupdb.3 \
471	pwcache.3 pwcache_userdb.3 \
472	pwcache.3 uid_from_user.3 \
473	pwcache.3 user_from_uid.3
474MLINKS+=rand48.3 _rand48.3 \
475	rand48.3 drand48.3 \
476	rand48.3 erand48.3 \
477	rand48.3 jrand48.3 \
478	rand48.3 lcong48.3 \
479	rand48.3 lrand48.3 \
480	rand48.3 mrand48.3 \
481	rand48.3 nrand48.3 \
482	rand48.3 seed48.3 \
483	rand48.3 srand48.3
484MLINKS+=scandir.3 alphasort.3 \
485	scandir.3 scandirat.3 \
486	scandir.3 scandir_b.3 \
487	scandir.3 versionsort.3
488MLINKS+=sem_open.3 sem_close.3 \
489	sem_open.3 sem_unlink.3
490MLINKS+=sem_wait.3 sem_trywait.3
491MLINKS+=sem_timedwait.3 sem_clockwait_np.3
492MLINKS+=setjmp.3 _longjmp.3 \
493	setjmp.3 _setjmp.3 \
494	setjmp.3 longjmp.3 \
495	setjmp.3 longjmperr.3 \
496	setjmp.3 longjmperror.3 \
497	setjmp.3 siglongjmp.3 \
498	setjmp.3 sigsetjmp.3
499MLINKS+=setmode.3 getmode.3
500MLINKS+=setproctitle.3 setproctitle_fast.3
501MLINKS+=sigsetops.3 sigaddset.3 \
502	sigsetops.3 sigandset.3 \
503	sigsetops.3 sigdelset.3 \
504	sigsetops.3 sigemptyset.3 \
505	sigsetops.3 sigfillset.3 \
506	sigsetops.3 sigisemptyset.3 \
507	sigsetops.3 sigismember.3 \
508	sigsetops.3 sigorset.3
509MLINKS+=statvfs.3 fstatvfs.3
510MLINKS+=stringlist.3 sl_add.3 \
511	stringlist.3 sl_find.3 \
512	stringlist.3 sl_free.3 \
513	stringlist.3 sl_init.3
514MLINKS+=strtofflags.3 fflagstostr.3
515MLINKS+=sysctl.3 sysctlbyname.3 \
516	sysctl.3 sysctlnametomib.3
517MLINKS+=syslog.3 closelog.3 \
518	syslog.3 openlog.3 \
519	syslog.3 setlogmask.3 \
520	syslog.3 vsyslog.3
521MLINKS+=tcgetwinsize.3 tcsetwinsize.3
522MLINKS+=tcsendbreak.3 tcdrain.3 \
523	tcsendbreak.3 tcflow.3 \
524	tcsendbreak.3 tcflush.3
525MLINKS+=tcsetattr.3 cfgetispeed.3 \
526	tcsetattr.3 cfgetospeed.3 \
527	tcsetattr.3 cfmakeraw.3 \
528	tcsetattr.3 cfmakesane.3 \
529	tcsetattr.3 cfsetispeed.3 \
530	tcsetattr.3 cfsetospeed.3 \
531	tcsetattr.3 cfsetspeed.3 \
532	tcsetattr.3 tcgetattr.3
533MLINKS+=ttyname.3 isatty.3 \
534	ttyname.3 ttyname_r.3
535MLINKS+=unvis.3 strunvis.3 \
536	unvis.3 strunvisx.3
537MLINKS+=vis.3 nvis.3 \
538	vis.3 snvis.3 \
539	vis.3 strenvisx.3 \
540	vis.3 strnunvis.3 \
541	vis.3 strnunvisx.3 \
542	vis.3 strnvis.3 \
543	vis.3 strnvisx.3 \
544	vis.3 strsenvisx.3 \
545	vis.3 strsnvis.3 \
546	vis.3 strsnvisx.3 \
547	vis.3 strsvis.3 \
548	vis.3 strsvisx.3 \
549	vis.3 strvis.3 \
550	vis.3 strvisx.3 \
551	vis.3 svis.3
552
553MLINKS+=wordexp.3 wordfree.3
554
555.include <src.tools.mk>
556
557afterinstallconfig: install-passwd
558install-passwd: .PHONY
559.if ${MK_TCSH} == "no"
560	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
561.endif
562	${PWD_MKDB_CMD} -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
563.if defined(NO_ROOT) && defined(METALOG)
564	( \
565		echo ".${DISTBASE}/etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
566		echo ".${DISTBASE}/etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
567		echo ".${DISTBASE}/etc/passwd type=file mode=0644 uname=root gname=wheel"; \
568	) | cat -l >> ${METALOG}
569.endif
570