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