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