xref: /freebsd/lib/libc/sys/Makefile.inc (revision a98ff317388a00b992f1bf8404dee596f9383f5e)
1#	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
2# $FreeBSD$
3
4# sys sources
5.PATH: ${.CURDIR}/${LIBC_ARCH}/sys ${.CURDIR}/sys
6
7# Include the generated makefile containing the *complete* list
8# of syscall names in MIASM.
9.include "${.CURDIR}/../../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 "${.CURDIR}/${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 !defined(WITHOUT_SYSCALL_COMPAT)
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+=	${.CURDIR}/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_mlock.2 \
89	aio_read.2 \
90	aio_return.2 \
91	aio_suspend.2 \
92	aio_waitcomplete.2 \
93	aio_write.2 \
94	bind.2 \
95	bindat.2 \
96	brk.2 \
97	cap_enter.2 \
98	cap_fcntls_limit.2 \
99	cap_ioctls_limit.2 \
100	cap_rights_limit.2 \
101	chdir.2 \
102	chflags.2 \
103	chmod.2 \
104	chown.2 \
105	chroot.2 \
106	clock_gettime.2 \
107	close.2 \
108	closefrom.2 \
109	connect.2 \
110	connectat.2 \
111	cpuset.2 \
112	cpuset_getaffinity.2 \
113	dup.2 \
114	execve.2 \
115	_exit.2 \
116	extattr_get_file.2 \
117	fcntl.2 \
118	ffclock.2 \
119	fhopen.2 \
120	flock.2 \
121	fork.2 \
122	fsync.2 \
123	getdirentries.2 \
124	getdtablesize.2 \
125	getfh.2 \
126	getfsstat.2 \
127	getgid.2 \
128	getgroups.2 \
129	getitimer.2 \
130	getlogin.2 \
131	getloginclass.2 \
132	getpeername.2 \
133	getpgrp.2 \
134	getpid.2 \
135	getpriority.2 \
136	getrlimit.2 \
137	getrusage.2 \
138	getsid.2 \
139	getsockname.2 \
140	getsockopt.2 \
141	gettimeofday.2 \
142	getuid.2 \
143	intro.2 \
144	ioctl.2 \
145	issetugid.2 \
146	jail.2 \
147	kenv.2 \
148	kill.2 \
149	kldfind.2 \
150	kldfirstmod.2 \
151	kldload.2 \
152	kldnext.2 \
153	kldstat.2 \
154	kldsym.2 \
155	kldunload.2 \
156	kqueue.2 \
157	ktrace.2 \
158	link.2 \
159	lio_listio.2 \
160	listen.2 \
161	lseek.2 \
162	madvise.2 \
163	mincore.2 \
164	minherit.2 \
165	mkdir.2 \
166	mkfifo.2 \
167	mknod.2 \
168	mlock.2 \
169	mlockall.2 \
170	mmap.2 \
171	modfind.2 \
172	modnext.2 \
173	modstat.2 \
174	mount.2 \
175	mprotect.2 \
176	mq_close.2 \
177	mq_getattr.2 \
178	mq_notify.2 \
179	mq_open.2 \
180	mq_receive.2 \
181	mq_send.2 \
182	mq_setattr.2 \
183	msgctl.2 \
184	msgget.2 \
185	msgrcv.2 \
186	msgsnd.2 \
187	msync.2 \
188	munmap.2 \
189	nanosleep.2 \
190	nfssvc.2 \
191	ntp_adjtime.2 \
192	open.2 \
193	pathconf.2 \
194	pdfork.2 \
195	pipe.2 \
196	poll.2 \
197	posix_fadvise.2 \
198	posix_fallocate.2 \
199	posix_openpt.2 \
200	profil.2 \
201	pselect.2 \
202	ptrace.2 \
203	quotactl.2 \
204	read.2 \
205	readlink.2 \
206	reboot.2 \
207	recv.2 \
208	rename.2 \
209	revoke.2 \
210	rfork.2 \
211	rmdir.2 \
212	rtprio.2
213.if !defined(NO_P1003_1B)
214MAN+=	sched_get_priority_max.2 \
215	sched_setparam.2 \
216	sched_setscheduler.2 \
217	sched_yield.2
218.endif
219MAN+=	sctp_generic_recvmsg.2 \
220	sctp_generic_sendmsg.2 \
221	sctp_peeloff.2 \
222	select.2 \
223	semctl.2 \
224	semget.2 \
225	semop.2 \
226	send.2 \
227	setfib.2 \
228	sendfile.2 \
229	setgroups.2 \
230	setpgid.2 \
231	setregid.2 \
232	setresuid.2 \
233	setreuid.2 \
234	setsid.2 \
235	setuid.2 \
236	shmat.2 \
237	shmctl.2 \
238	shmget.2 \
239	shm_open.2 \
240	shutdown.2 \
241	sigaction.2 \
242	sigaltstack.2 \
243	sigpending.2 \
244	sigprocmask.2 \
245	sigqueue.2 \
246	sigreturn.2 \
247	sigstack.2 \
248	sigsuspend.2 \
249	sigwait.2 \
250	sigwaitinfo.2 \
251	socket.2 \
252	socketpair.2 \
253	stat.2 \
254	statfs.2 \
255	swapon.2 \
256	symlink.2 \
257	sync.2 \
258	sysarch.2 \
259	syscall.2 \
260	timer_create.2 \
261	timer_delete.2 \
262	timer_settime.2 \
263	truncate.2 \
264	umask.2 \
265	undelete.2 \
266	unlink.2 \
267	utimes.2 \
268	utrace.2 \
269	uuidgen.2 \
270	vfork.2 \
271	wait.2 \
272	write.2
273
274MLINKS+=accept.2 accept4.2
275MLINKS+=access.2 eaccess.2 \
276	access.2 faccessat.2
277MLINKS+=brk.2 sbrk.2
278MLINKS+=cap_enter.2 cap_getmode.2
279MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
280MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
281MLINKS+=cap_rights_limit.2 cap_rights_get.2
282MLINKS+=chdir.2 fchdir.2
283MLINKS+=chflags.2 chflagsat.2 \
284	chflags.2 fchflags.2 \
285	chflags.2 lchflags.2
286MLINKS+=chmod.2 fchmod.2 \
287	chmod.2 fchmodat.2 \
288	chmod.2 lchmod.2
289MLINKS+=chown.2 fchown.2 \
290	chown.2 fchownat.2 \
291	chown.2 lchown.2
292MLINKS+=clock_gettime.2 clock_getres.2 \
293	clock_gettime.2 clock_settime.2
294MLINKS+=cpuset.2 cpuset_getid.2 \
295	cpuset.2 cpuset_setid.2
296MLINKS+=cpuset_getaffinity.2 cpuset_setaffinity.2
297MLINKS+=dup.2 dup2.2
298MLINKS+=execve.2 fexecve.2
299MLINKS+=extattr_get_file.2 extattr.2 \
300	extattr_get_file.2 extattr_delete_fd.2 \
301	extattr_get_file.2 extattr_delete_file.2 \
302	extattr_get_file.2 extattr_delete_list.2 \
303	extattr_get_file.2 extattr_get_fd.2 \
304	extattr_get_file.2 extattr_get_list.2 \
305	extattr_get_file.2 extattr_list_fd.2 \
306	extattr_get_file.2 extattr_list_file.2 \
307	extattr_get_file.2 extattr_list_link.2 \
308	extattr_get_file.2 extattr_set_fd.2 \
309	extattr_get_file.2 extattr_set_file.2 \
310	extattr_get_file.2 extattr_set_link.2
311MLINKS+=ffclock.2 ffclock_getcounter.2 \
312	ffclock.2 ffclock_getestimate.2 \
313	ffclock.2 ffclock_setestimate.2
314MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
315MLINKS+=getdirentries.2 getdents.2
316MLINKS+=getfh.2 lgetfh.2
317MLINKS+=getgid.2 getegid.2
318MLINKS+=getitimer.2 setitimer.2
319MLINKS+=getlogin.2 getlogin_r.3
320MLINKS+=getlogin.2 setlogin.2
321MLINKS+=getloginclass.2 setloginclass.2
322MLINKS+=getpgrp.2 getpgid.2
323MLINKS+=getpid.2 getppid.2
324MLINKS+=getpriority.2 setpriority.2
325MLINKS+=getrlimit.2 setrlimit.2
326MLINKS+=getsockopt.2 setsockopt.2
327MLINKS+=gettimeofday.2 settimeofday.2
328MLINKS+=getuid.2 geteuid.2
329MLINKS+=intro.2 errno.2
330MLINKS+=jail.2 jail_attach.2 \
331	jail.2 jail_get.2 \
332	jail.2 jail_remove.2 \
333	jail.2 jail_set.2
334MLINKS+=kldunload.2 kldunloadf.2
335MLINKS+=kqueue.2 kevent.2 \
336	kqueue.2 EV_SET.3
337MLINKS+=link.2 linkat.2
338MLINKS+=madvise.2 posix_madvise.2
339MLINKS+=mkdir.2 mkdirat.2
340MLINKS+=mkfifo.2 mkfifoat.2
341MLINKS+=mknod.2 mknodat.2
342MLINKS+=mlock.2 munlock.2
343MLINKS+=mlockall.2 munlockall.2
344MLINKS+=modnext.2 modfnext.2
345MLINKS+=mount.2 nmount.2 \
346	mount.2 unmount.2
347MLINKS+=mq_receive.2 mq_timedreceive.2
348MLINKS+=mq_send.2 mq_timedsend.2
349MLINKS+=ntp_adjtime.2 ntp_gettime.2
350MLINKS+=open.2 openat.2
351MLINKS+=pathconf.2 fpathconf.2
352MLINKS+=pathconf.2 lpathconf.2
353MLINKS+=pdfork.2 pdgetpid.2\
354	pdfork.2 pdkill.2 \
355	pdfork.2 pdwait4.2
356MLINKS+=pipe.2 pipe2.2
357MLINKS+=read.2 pread.2 \
358	read.2 preadv.2 \
359	read.2 readv.2
360MLINKS+=readlink.2 readlinkat.2
361MLINKS+=recv.2 recvfrom.2 \
362	recv.2 recvmsg.2
363MLINKS+=rename.2 renameat.2
364MLINKS+=rtprio.2 rtprio_thread.2
365.if !defined(NO_P1003_1B)
366MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \
367	sched_get_priority_max.2 sched_rr_get_interval.2
368MLINKS+=sched_setparam.2 sched_getparam.2
369MLINKS+=sched_setscheduler.2 sched_getscheduler.2
370.endif
371MLINKS+=select.2 FD_CLR.3 \
372	select.2 FD_ISSET.3 \
373	select.2 FD_SET.3 \
374	select.2 FD_ZERO.3
375MLINKS+=send.2 sendmsg.2 \
376	send.2 sendto.2
377MLINKS+=setpgid.2 setpgrp.2
378MLINKS+=setresuid.2 getresgid.2 \
379	setresuid.2 getresuid.2 \
380	setresuid.2 setresgid.2
381MLINKS+=setuid.2 setegid.2 \
382	setuid.2 seteuid.2 \
383	setuid.2 setgid.2
384MLINKS+=shmat.2 shmdt.2
385MLINKS+=shm_open.2 shm_unlink.2
386MLINKS+=sigwaitinfo.2 sigtimedwait.2
387MLINKS+=stat.2 fstat.2 \
388	stat.2 fstatat.2 \
389	stat.2 lstat.2
390MLINKS+=statfs.2 fstatfs.2
391MLINKS+=swapon.2 swapoff.2
392MLINKS+=symlink.2 symlinkat.2
393MLINKS+=syscall.2 __syscall.2
394MLINKS+=timer_settime.2 timer_getoverrun.2 \
395	timer_settime.2 timer_gettime.2
396MLINKS+=truncate.2 ftruncate.2
397MLINKS+=unlink.2 unlinkat.2
398MLINKS+=utimes.2 futimes.2 \
399	utimes.2 futimesat.2 \
400	utimes.2 lutimes.2
401MLINKS+=wait.2 wait3.2 \
402	wait.2 wait4.2 \
403	wait.2 waitpid.2 \
404	wait.2 waitid.2 \
405	wait.2 wait6.2
406MLINKS+=write.2 pwrite.2 \
407	write.2 pwritev.2 \
408	write.2 writev.2
409