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