xref: /freebsd/lib/libc/sys/Makefile.inc (revision ea825d02749f382c3f7e17f28247f20a48733eab)
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	dup.2 \
178	execve.2 \
179	_exit.2 \
180	extattr_get_file.2 \
181	fcntl.2 \
182	ffclock.2 \
183	fhopen.2 \
184	flock.2 \
185	fork.2 \
186	fsync.2 \
187	getdirentries.2 \
188	getdtablesize.2 \
189	getfh.2 \
190	getfsstat.2 \
191	getgid.2 \
192	getgroups.2 \
193	getitimer.2 \
194	getlogin.2 \
195	getloginclass.2 \
196	getpeername.2 \
197	getpgrp.2 \
198	getpid.2 \
199	getpriority.2 \
200	getrlimit.2 \
201	getrusage.2 \
202	getsid.2 \
203	getsockname.2 \
204	getsockopt.2 \
205	gettimeofday.2 \
206	getuid.2 \
207	intro.2 \
208	ioctl.2 \
209	issetugid.2 \
210	jail.2 \
211	kenv.2 \
212	kill.2 \
213	kldfind.2 \
214	kldfirstmod.2 \
215	kldload.2 \
216	kldnext.2 \
217	kldstat.2 \
218	kldsym.2 \
219	kldunload.2 \
220	kqueue.2 \
221	ktrace.2 \
222	link.2 \
223	lio_listio.2 \
224	listen.2 \
225	lseek.2 \
226	madvise.2 \
227	mincore.2 \
228	minherit.2 \
229	mkdir.2 \
230	mkfifo.2 \
231	mknod.2 \
232	mlock.2 \
233	mlockall.2 \
234	mmap.2 \
235	modfind.2 \
236	modnext.2 \
237	modstat.2 \
238	mount.2 \
239	mprotect.2 \
240	mq_close.2 \
241	mq_getattr.2 \
242	mq_notify.2 \
243	mq_open.2 \
244	mq_receive.2 \
245	mq_send.2 \
246	mq_setattr.2 \
247	msgctl.2 \
248	msgget.2 \
249	msgrcv.2 \
250	msgsnd.2 \
251	msync.2 \
252	munmap.2 \
253	nanosleep.2 \
254	nfssvc.2 \
255	ntp_adjtime.2 \
256	numa_getaffinity.2 \
257	open.2 \
258	pathconf.2 \
259	pdfork.2 \
260	pipe.2 \
261	poll.2 \
262	posix_fadvise.2 \
263	posix_fallocate.2 \
264	posix_openpt.2 \
265	procctl.2 \
266	profil.2 \
267	pselect.2 \
268	ptrace.2 \
269	quotactl.2 \
270	rctl_add_rule.2 \
271	read.2 \
272	readlink.2 \
273	reboot.2 \
274	recv.2 \
275	rename.2 \
276	revoke.2 \
277	rfork.2 \
278	rmdir.2 \
279	rtprio.2
280.if !defined(NO_P1003_1B)
281MAN+=	sched_get_priority_max.2 \
282	sched_setparam.2 \
283	sched_setscheduler.2 \
284	sched_yield.2
285.endif
286MAN+=	sctp_generic_recvmsg.2 \
287	sctp_generic_sendmsg.2 \
288	sctp_peeloff.2 \
289	select.2 \
290	semctl.2 \
291	semget.2 \
292	semop.2 \
293	send.2 \
294	setfib.2 \
295	sendfile.2 \
296	setgroups.2 \
297	setpgid.2 \
298	setregid.2 \
299	setresuid.2 \
300	setreuid.2 \
301	setsid.2 \
302	setuid.2 \
303	shmat.2 \
304	shmctl.2 \
305	shmget.2 \
306	shm_open.2 \
307	shutdown.2 \
308	sigaction.2 \
309	sigaltstack.2 \
310	sigpending.2 \
311	sigprocmask.2 \
312	sigqueue.2 \
313	sigreturn.2 \
314	sigstack.2 \
315	sigsuspend.2 \
316	sigwait.2 \
317	sigwaitinfo.2 \
318	socket.2 \
319	socketpair.2 \
320	stat.2 \
321	statfs.2 \
322	swapon.2 \
323	symlink.2 \
324	sync.2 \
325	sysarch.2 \
326	syscall.2 \
327	thr_exit.2 \
328	thr_kill.2 \
329	thr_new.2 \
330	thr_self.2 \
331	thr_set_name.2 \
332	thr_suspend.2 \
333	thr_wake.2 \
334	timer_create.2 \
335	timer_delete.2 \
336	timer_settime.2 \
337	truncate.2 \
338	umask.2 \
339	undelete.2 \
340	unlink.2 \
341	utimensat.2 \
342	utimes.2 \
343	utrace.2 \
344	uuidgen.2 \
345	vfork.2 \
346	wait.2 \
347	write.2 \
348	_umtx_op.2
349
350MLINKS+=accept.2 accept4.2
351MLINKS+=access.2 eaccess.2 \
352	access.2 faccessat.2
353MLINKS+=brk.2 sbrk.2
354MLINKS+=cap_enter.2 cap_getmode.2
355MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
356MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
357MLINKS+=chdir.2 fchdir.2
358MLINKS+=chflags.2 chflagsat.2 \
359	chflags.2 fchflags.2 \
360	chflags.2 lchflags.2
361MLINKS+=chmod.2 fchmod.2 \
362	chmod.2 fchmodat.2 \
363	chmod.2 lchmod.2
364MLINKS+=chown.2 fchown.2 \
365	chown.2 fchownat.2 \
366	chown.2 lchown.2
367MLINKS+=clock_gettime.2 clock_getres.2 \
368	clock_gettime.2 clock_settime.2
369MLINKS+=nanosleep.2 clock_nanosleep.2
370MLINKS+=cpuset.2 cpuset_getid.2 \
371	cpuset.2 cpuset_setid.2
372MLINKS+=cpuset_getaffinity.2 cpuset_setaffinity.2
373MLINKS+=dup.2 dup2.2
374MLINKS+=execve.2 fexecve.2
375MLINKS+=extattr_get_file.2 extattr.2 \
376	extattr_get_file.2 extattr_delete_fd.2 \
377	extattr_get_file.2 extattr_delete_file.2 \
378	extattr_get_file.2 extattr_delete_link.2 \
379	extattr_get_file.2 extattr_get_fd.2 \
380	extattr_get_file.2 extattr_get_link.2 \
381	extattr_get_file.2 extattr_list_fd.2 \
382	extattr_get_file.2 extattr_list_file.2 \
383	extattr_get_file.2 extattr_list_link.2 \
384	extattr_get_file.2 extattr_set_fd.2 \
385	extattr_get_file.2 extattr_set_file.2 \
386	extattr_get_file.2 extattr_set_link.2
387MLINKS+=ffclock.2 ffclock_getcounter.2 \
388	ffclock.2 ffclock_getestimate.2 \
389	ffclock.2 ffclock_setestimate.2
390MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
391MLINKS+=fsync.2 fdatasync.2
392MLINKS+=getdirentries.2 getdents.2
393MLINKS+=getfh.2 lgetfh.2
394MLINKS+=getgid.2 getegid.2
395MLINKS+=getitimer.2 setitimer.2
396MLINKS+=getlogin.2 getlogin_r.3
397MLINKS+=getlogin.2 setlogin.2
398MLINKS+=getloginclass.2 setloginclass.2
399MLINKS+=getpgrp.2 getpgid.2
400MLINKS+=getpid.2 getppid.2
401MLINKS+=getpriority.2 setpriority.2
402MLINKS+=getrlimit.2 setrlimit.2
403MLINKS+=getsockopt.2 setsockopt.2
404MLINKS+=gettimeofday.2 settimeofday.2
405MLINKS+=getuid.2 geteuid.2
406MLINKS+=intro.2 errno.2
407MLINKS+=jail.2 jail_attach.2 \
408	jail.2 jail_get.2 \
409	jail.2 jail_remove.2 \
410	jail.2 jail_set.2
411MLINKS+=kldunload.2 kldunloadf.2
412MLINKS+=kqueue.2 kevent.2 \
413	kqueue.2 EV_SET.3
414MLINKS+=link.2 linkat.2
415MLINKS+=madvise.2 posix_madvise.2
416MLINKS+=mkdir.2 mkdirat.2
417MLINKS+=mkfifo.2 mkfifoat.2
418MLINKS+=mknod.2 mknodat.2
419MLINKS+=mlock.2 munlock.2
420MLINKS+=mlockall.2 munlockall.2
421MLINKS+=modnext.2 modfnext.2
422MLINKS+=mount.2 nmount.2 \
423	mount.2 unmount.2
424MLINKS+=mq_receive.2 mq_timedreceive.2
425MLINKS+=mq_send.2 mq_timedsend.2
426MLINKS+=ntp_adjtime.2 ntp_gettime.2
427MLINKS+=numa_getaffinity.2 numa_setaffinity.2
428MLINKS+=open.2 openat.2
429MLINKS+=pathconf.2 fpathconf.2
430MLINKS+=pathconf.2 lpathconf.2
431MLINKS+=pdfork.2 pdgetpid.2\
432	pdfork.2 pdkill.2
433MLINKS+=pipe.2 pipe2.2
434MLINKS+=poll.2 ppoll.2
435MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \
436	rctl_add_rule.2 rctl_get_racct.2 \
437	rctl_add_rule.2 rctl_get_rules.2 \
438	rctl_add_rule.2 rctl_remove_rule.2
439MLINKS+=read.2 pread.2 \
440	read.2 preadv.2 \
441	read.2 readv.2
442MLINKS+=readlink.2 readlinkat.2
443MLINKS+=recv.2 recvfrom.2 \
444	recv.2 recvmsg.2
445MLINKS+=rename.2 renameat.2
446MLINKS+=rtprio.2 rtprio_thread.2
447.if !defined(NO_P1003_1B)
448MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \
449	sched_get_priority_max.2 sched_rr_get_interval.2
450MLINKS+=sched_setparam.2 sched_getparam.2
451MLINKS+=sched_setscheduler.2 sched_getscheduler.2
452.endif
453MLINKS+=select.2 FD_CLR.3 \
454	select.2 FD_ISSET.3 \
455	select.2 FD_SET.3 \
456	select.2 FD_ZERO.3
457MLINKS+=send.2 sendmsg.2 \
458	send.2 sendto.2
459MLINKS+=setpgid.2 setpgrp.2
460MLINKS+=setresuid.2 getresgid.2 \
461	setresuid.2 getresuid.2 \
462	setresuid.2 setresgid.2
463MLINKS+=setuid.2 setegid.2 \
464	setuid.2 seteuid.2 \
465	setuid.2 setgid.2
466MLINKS+=shmat.2 shmdt.2
467MLINKS+=shm_open.2 shm_unlink.2
468MLINKS+=sigwaitinfo.2 sigtimedwait.2
469MLINKS+=stat.2 fstat.2 \
470	stat.2 fstatat.2 \
471	stat.2 lstat.2
472MLINKS+=statfs.2 fstatfs.2
473MLINKS+=swapon.2 swapoff.2
474MLINKS+=symlink.2 symlinkat.2
475MLINKS+=syscall.2 __syscall.2
476MLINKS+=timer_settime.2 timer_getoverrun.2 \
477	timer_settime.2 timer_gettime.2
478MLINKS+=thr_kill.2 thr_kill2.2
479MLINKS+=truncate.2 ftruncate.2
480MLINKS+=unlink.2 unlinkat.2
481MLINKS+=utimensat.2 futimens.2
482MLINKS+=utimes.2 futimes.2 \
483	utimes.2 futimesat.2 \
484	utimes.2 lutimes.2
485MLINKS+=wait.2 wait3.2 \
486	wait.2 wait4.2 \
487	wait.2 waitpid.2 \
488	wait.2 waitid.2 \
489	wait.2 wait6.2
490MLINKS+=write.2 pwrite.2 \
491	write.2 pwritev.2 \
492	write.2 writev.2
493