xref: /freebsd/lib/libc/sys/Makefile.inc (revision 5477372324b92240a96310ef2d45fa44ce8d0a93)
1#	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
2# $FreeBSD$
3
4# sys sources
5.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/sys ${LIBC_SRCTOP}/sys
6
7# Include the generated makefile containing the *complete* list
8# of syscall names in MIASM.
9.include "${SRCTOP}/sys/sys/syscall.mk"
10
11# Include machine dependent definitions.
12#
13# MDASM names override the default syscall names in MIASM.
14# NOASM will prevent the default syscall code from being generated.
15# PSEUDO generates _<sys>() and __sys_<sys>() symbols, but not <sys>().
16#
17# While historically machine dependent, all architectures have the following
18# declarations in common:
19#
20NOASM=	break.o \
21	exit.o \
22	getlogin.o \
23	sstk.o \
24	yield.o
25PSEUDO=	_exit.o \
26	_getlogin.o
27.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/sys/Makefile.inc"
28
29SRCS+= clock_gettime.c gettimeofday.c __vdso_gettimeofday.c
30NOASM+=  clock_gettime.o gettimeofday.o
31PSEUDO+= _clock_gettime.o _gettimeofday.o
32
33# Sources common to both syscall interfaces:
34SRCS+=	\
35	__error.c \
36	interposing_table.c
37
38SRCS+= futimens.c utimensat.c
39NOASM+= futimens.o utimensat.o
40PSEUDO+= _futimens.o _utimensat.o
41
42SRCS+= pipe.c
43
44INTERPOSED = \
45	accept \
46	accept4 \
47	aio_suspend \
48	clock_nanosleep \
49	close \
50	connect \
51	fcntl \
52	fdatasync \
53	fsync \
54	fork \
55	kevent \
56	msync \
57	nanosleep \
58	open \
59	openat \
60	poll \
61	ppoll \
62	pselect \
63	ptrace \
64	read \
65	readv \
66	recvfrom \
67	recvmsg \
68	select \
69	sendmsg \
70	sendto \
71	setcontext \
72	sigprocmask \
73	sigsuspend \
74	sigtimedwait \
75	sigwait \
76	sigwaitinfo \
77	swapcontext \
78	wait4 \
79	wait6 \
80	write \
81	writev
82
83.if ${MACHINE_CPUARCH} == "sparc64"
84SRCS+=	sigaction.c
85NOASM+=	sigaction.o
86.else
87INTERPOSED+= sigaction
88.endif
89
90SRCS+=	${INTERPOSED:S/$/.c/}
91NOASM+=	${INTERPOSED:S/$/.o/}
92PSEUDO+=	${INTERPOSED:C/^.*$/_&.o/}
93
94# Add machine dependent asm sources:
95SRCS+=${MDASM}
96
97# Look though the complete list of syscalls (MIASM) for names that are
98# not defined with machine dependent implementations (MDASM) and are
99# not declared for no generation of default code (NOASM).  Add each
100# syscall that satisfies these conditions to the ASM list.
101.for _asm in ${MIASM}
102.if (${MDASM:R:M${_asm:R}} == "")
103.if (${NOASM:R:M${_asm:R}} == "")
104ASM+=$(_asm)
105.endif
106.endif
107.endfor
108
109SASM=	${ASM:S/.o/.S/}
110
111SPSEUDO= ${PSEUDO:S/.o/.S/}
112
113SRCS+=	${SASM} ${SPSEUDO}
114
115SYM_MAPS+=	${LIBC_SRCTOP}/sys/Symbol.map
116
117# Generated files
118CLEANFILES+=	${SASM} ${SPSEUDO}
119
120.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
121    ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*}
122NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n'
123.else
124NOTE_GNU_STACK=''
125.endif
126
127${SASM}:
128	printf '#include "compat.h"\n' > ${.TARGET}
129	printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET}
130	printf  ${NOTE_GNU_STACK} >>${.TARGET}
131
132${SPSEUDO}:
133	printf '#include "compat.h"\n' > ${.TARGET}
134	printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \
135	    >> ${.TARGET}
136	printf ${NOTE_GNU_STACK} >>${.TARGET}
137
138MAN+=	abort2.2 \
139	accept.2 \
140	access.2 \
141	acct.2 \
142	adjtime.2 \
143	aio_cancel.2 \
144	aio_error.2 \
145	aio_fsync.2 \
146	aio_mlock.2 \
147	aio_read.2 \
148	aio_return.2 \
149	aio_suspend.2 \
150	aio_waitcomplete.2 \
151	aio_write.2 \
152	bind.2 \
153	bindat.2 \
154	brk.2 \
155	cap_enter.2 \
156	cap_fcntls_limit.2 \
157	cap_ioctls_limit.2 \
158	cap_rights_limit.2 \
159	chdir.2 \
160	chflags.2 \
161	chmod.2 \
162	chown.2 \
163	chroot.2 \
164	clock_gettime.2 \
165	close.2 \
166	closefrom.2 \
167	connect.2 \
168	connectat.2 \
169	cpuset.2 \
170	cpuset_getaffinity.2 \
171	dup.2 \
172	execve.2 \
173	_exit.2 \
174	extattr_get_file.2 \
175	fcntl.2 \
176	ffclock.2 \
177	fhopen.2 \
178	flock.2 \
179	fork.2 \
180	fsync.2 \
181	getdirentries.2 \
182	getdtablesize.2 \
183	getfh.2 \
184	getfsstat.2 \
185	getgid.2 \
186	getgroups.2 \
187	getitimer.2 \
188	getlogin.2 \
189	getloginclass.2 \
190	getpeername.2 \
191	getpgrp.2 \
192	getpid.2 \
193	getpriority.2 \
194	getrlimit.2 \
195	getrusage.2 \
196	getsid.2 \
197	getsockname.2 \
198	getsockopt.2 \
199	gettimeofday.2 \
200	getuid.2 \
201	intro.2 \
202	ioctl.2 \
203	issetugid.2 \
204	jail.2 \
205	kenv.2 \
206	kill.2 \
207	kldfind.2 \
208	kldfirstmod.2 \
209	kldload.2 \
210	kldnext.2 \
211	kldstat.2 \
212	kldsym.2 \
213	kldunload.2 \
214	kqueue.2 \
215	ktrace.2 \
216	link.2 \
217	lio_listio.2 \
218	listen.2 \
219	lseek.2 \
220	madvise.2 \
221	mincore.2 \
222	minherit.2 \
223	mkdir.2 \
224	mkfifo.2 \
225	mknod.2 \
226	mlock.2 \
227	mlockall.2 \
228	mmap.2 \
229	modfind.2 \
230	modnext.2 \
231	modstat.2 \
232	mount.2 \
233	mprotect.2 \
234	mq_close.2 \
235	mq_getattr.2 \
236	mq_notify.2 \
237	mq_open.2 \
238	mq_receive.2 \
239	mq_send.2 \
240	mq_setattr.2 \
241	msgctl.2 \
242	msgget.2 \
243	msgrcv.2 \
244	msgsnd.2 \
245	msync.2 \
246	munmap.2 \
247	nanosleep.2 \
248	nfssvc.2 \
249	ntp_adjtime.2 \
250	numa_getaffinity.2 \
251	open.2 \
252	pathconf.2 \
253	pdfork.2 \
254	pipe.2 \
255	poll.2 \
256	posix_fadvise.2 \
257	posix_fallocate.2 \
258	posix_openpt.2 \
259	procctl.2 \
260	profil.2 \
261	pselect.2 \
262	ptrace.2 \
263	quotactl.2 \
264	rctl_add_rule.2 \
265	read.2 \
266	readlink.2 \
267	reboot.2 \
268	recv.2 \
269	rename.2 \
270	revoke.2 \
271	rfork.2 \
272	rmdir.2 \
273	rtprio.2
274.if !defined(NO_P1003_1B)
275MAN+=	sched_get_priority_max.2 \
276	sched_setparam.2 \
277	sched_setscheduler.2 \
278	sched_yield.2
279.endif
280MAN+=	sctp_generic_recvmsg.2 \
281	sctp_generic_sendmsg.2 \
282	sctp_peeloff.2 \
283	select.2 \
284	semctl.2 \
285	semget.2 \
286	semop.2 \
287	send.2 \
288	setfib.2 \
289	sendfile.2 \
290	setgroups.2 \
291	setpgid.2 \
292	setregid.2 \
293	setresuid.2 \
294	setreuid.2 \
295	setsid.2 \
296	setuid.2 \
297	shmat.2 \
298	shmctl.2 \
299	shmget.2 \
300	shm_open.2 \
301	shutdown.2 \
302	sigaction.2 \
303	sigaltstack.2 \
304	sigpending.2 \
305	sigprocmask.2 \
306	sigqueue.2 \
307	sigreturn.2 \
308	sigstack.2 \
309	sigsuspend.2 \
310	sigwait.2 \
311	sigwaitinfo.2 \
312	socket.2 \
313	socketpair.2 \
314	stat.2 \
315	statfs.2 \
316	swapon.2 \
317	symlink.2 \
318	sync.2 \
319	sysarch.2 \
320	syscall.2 \
321	thr_exit.2 \
322	thr_kill.2 \
323	thr_new.2 \
324	thr_self.2 \
325	thr_set_name.2 \
326	thr_suspend.2 \
327	thr_wake.2 \
328	timer_create.2 \
329	timer_delete.2 \
330	timer_settime.2 \
331	truncate.2 \
332	umask.2 \
333	undelete.2 \
334	unlink.2 \
335	utimensat.2 \
336	utimes.2 \
337	utrace.2 \
338	uuidgen.2 \
339	vfork.2 \
340	wait.2 \
341	write.2 \
342	_umtx_op.2
343
344MLINKS+=accept.2 accept4.2
345MLINKS+=access.2 eaccess.2 \
346	access.2 faccessat.2
347MLINKS+=brk.2 sbrk.2
348MLINKS+=cap_enter.2 cap_getmode.2
349MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
350MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
351MLINKS+=cap_rights_limit.2 cap_rights_get.2
352MLINKS+=chdir.2 fchdir.2
353MLINKS+=chflags.2 chflagsat.2 \
354	chflags.2 fchflags.2 \
355	chflags.2 lchflags.2
356MLINKS+=chmod.2 fchmod.2 \
357	chmod.2 fchmodat.2 \
358	chmod.2 lchmod.2
359MLINKS+=chown.2 fchown.2 \
360	chown.2 fchownat.2 \
361	chown.2 lchown.2
362MLINKS+=clock_gettime.2 clock_getres.2 \
363	clock_gettime.2 clock_settime.2
364MLINKS+=nanosleep.2 clock_nanosleep.2
365MLINKS+=cpuset.2 cpuset_getid.2 \
366	cpuset.2 cpuset_setid.2
367MLINKS+=cpuset_getaffinity.2 cpuset_setaffinity.2
368MLINKS+=dup.2 dup2.2
369MLINKS+=execve.2 fexecve.2
370MLINKS+=extattr_get_file.2 extattr.2 \
371	extattr_get_file.2 extattr_delete_fd.2 \
372	extattr_get_file.2 extattr_delete_file.2 \
373	extattr_get_file.2 extattr_delete_link.2 \
374	extattr_get_file.2 extattr_get_fd.2 \
375	extattr_get_file.2 extattr_get_link.2 \
376	extattr_get_file.2 extattr_list_fd.2 \
377	extattr_get_file.2 extattr_list_file.2 \
378	extattr_get_file.2 extattr_list_link.2 \
379	extattr_get_file.2 extattr_set_fd.2 \
380	extattr_get_file.2 extattr_set_file.2 \
381	extattr_get_file.2 extattr_set_link.2
382MLINKS+=ffclock.2 ffclock_getcounter.2 \
383	ffclock.2 ffclock_getestimate.2 \
384	ffclock.2 ffclock_setestimate.2
385MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
386MLINKS+=fsync.2 fdatasync.2
387MLINKS+=getdirentries.2 getdents.2
388MLINKS+=getfh.2 lgetfh.2
389MLINKS+=getgid.2 getegid.2
390MLINKS+=getitimer.2 setitimer.2
391MLINKS+=getlogin.2 getlogin_r.3
392MLINKS+=getlogin.2 setlogin.2
393MLINKS+=getloginclass.2 setloginclass.2
394MLINKS+=getpgrp.2 getpgid.2
395MLINKS+=getpid.2 getppid.2
396MLINKS+=getpriority.2 setpriority.2
397MLINKS+=getrlimit.2 setrlimit.2
398MLINKS+=getsockopt.2 setsockopt.2
399MLINKS+=gettimeofday.2 settimeofday.2
400MLINKS+=getuid.2 geteuid.2
401MLINKS+=intro.2 errno.2
402MLINKS+=jail.2 jail_attach.2 \
403	jail.2 jail_get.2 \
404	jail.2 jail_remove.2 \
405	jail.2 jail_set.2
406MLINKS+=kldunload.2 kldunloadf.2
407MLINKS+=kqueue.2 kevent.2 \
408	kqueue.2 EV_SET.3
409MLINKS+=link.2 linkat.2
410MLINKS+=madvise.2 posix_madvise.2
411MLINKS+=mkdir.2 mkdirat.2
412MLINKS+=mkfifo.2 mkfifoat.2
413MLINKS+=mknod.2 mknodat.2
414MLINKS+=mlock.2 munlock.2
415MLINKS+=mlockall.2 munlockall.2
416MLINKS+=modnext.2 modfnext.2
417MLINKS+=mount.2 nmount.2 \
418	mount.2 unmount.2
419MLINKS+=mq_receive.2 mq_timedreceive.2
420MLINKS+=mq_send.2 mq_timedsend.2
421MLINKS+=ntp_adjtime.2 ntp_gettime.2
422MLINKS+=numa_getaffinity.2 numa_setaffinity.2
423MLINKS+=open.2 openat.2
424MLINKS+=pathconf.2 fpathconf.2
425MLINKS+=pathconf.2 lpathconf.2
426MLINKS+=pdfork.2 pdgetpid.2\
427	pdfork.2 pdkill.2 \
428	pdfork.2 pdwait4.2
429MLINKS+=pipe.2 pipe2.2
430MLINKS+=poll.2 ppoll.2
431MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \
432	rctl_add_rule.2 rctl_get_racct.2 \
433	rctl_add_rule.2 rctl_get_rules.2 \
434	rctl_add_rule.2 rctl_remove_rule.2
435MLINKS+=read.2 pread.2 \
436	read.2 preadv.2 \
437	read.2 readv.2
438MLINKS+=readlink.2 readlinkat.2
439MLINKS+=recv.2 recvfrom.2 \
440	recv.2 recvmsg.2
441MLINKS+=rename.2 renameat.2
442MLINKS+=rtprio.2 rtprio_thread.2
443.if !defined(NO_P1003_1B)
444MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \
445	sched_get_priority_max.2 sched_rr_get_interval.2
446MLINKS+=sched_setparam.2 sched_getparam.2
447MLINKS+=sched_setscheduler.2 sched_getscheduler.2
448.endif
449MLINKS+=select.2 FD_CLR.3 \
450	select.2 FD_ISSET.3 \
451	select.2 FD_SET.3 \
452	select.2 FD_ZERO.3
453MLINKS+=send.2 sendmsg.2 \
454	send.2 sendto.2
455MLINKS+=setpgid.2 setpgrp.2
456MLINKS+=setresuid.2 getresgid.2 \
457	setresuid.2 getresuid.2 \
458	setresuid.2 setresgid.2
459MLINKS+=setuid.2 setegid.2 \
460	setuid.2 seteuid.2 \
461	setuid.2 setgid.2
462MLINKS+=shmat.2 shmdt.2
463MLINKS+=shm_open.2 shm_unlink.2
464MLINKS+=sigwaitinfo.2 sigtimedwait.2
465MLINKS+=stat.2 fstat.2 \
466	stat.2 fstatat.2 \
467	stat.2 lstat.2
468MLINKS+=statfs.2 fstatfs.2
469MLINKS+=swapon.2 swapoff.2
470MLINKS+=symlink.2 symlinkat.2
471MLINKS+=syscall.2 __syscall.2
472MLINKS+=timer_settime.2 timer_getoverrun.2 \
473	timer_settime.2 timer_gettime.2
474MLINKS+=thr_kill.2 thr_kill2.2
475MLINKS+=truncate.2 ftruncate.2
476MLINKS+=unlink.2 unlinkat.2
477MLINKS+=utimensat.2 futimens.2
478MLINKS+=utimes.2 futimes.2 \
479	utimes.2 futimesat.2 \
480	utimes.2 lutimes.2
481MLINKS+=wait.2 wait3.2 \
482	wait.2 wait4.2 \
483	wait.2 waitpid.2 \
484	wait.2 waitid.2 \
485	wait.2 wait6.2
486MLINKS+=write.2 pwrite.2 \
487	write.2 pwritev.2 \
488	write.2 writev.2
489