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