Makefile.inc revision 317618
1#	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
2# $FreeBSD: stable/11/lib/libc/sys/Makefile.inc 317618 2017-05-01 01:36:54Z vangyzen $
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#
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	__error.c \
25	interposing_table.c
26
27SRCS+= futimens.c utimensat.c
28NOASM+= futimens.o utimensat.o
29PSEUDO+= _futimens.o _utimensat.o
30
31SRCS+= pipe.c
32
33INTERPOSED = \
34	accept \
35	accept4 \
36	aio_suspend \
37	clock_nanosleep \
38	close \
39	connect \
40	fcntl \
41	fdatasync \
42	fsync \
43	fork \
44	kevent \
45	msync \
46	nanosleep \
47	open \
48	openat \
49	poll \
50	ppoll \
51	pselect \
52	ptrace \
53	read \
54	readv \
55	recvfrom \
56	recvmsg \
57	select \
58	sendmsg \
59	sendto \
60	setcontext \
61	sigprocmask \
62	sigsuspend \
63	sigtimedwait \
64	sigwait \
65	sigwaitinfo \
66	swapcontext \
67	wait4 \
68	wait6 \
69	write \
70	writev
71
72.if ${MACHINE_CPUARCH} == "sparc64"
73SRCS+=	sigaction.c
74NOASM+=	sigaction.o
75.else
76INTERPOSED+= sigaction
77.endif
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
98SASM=	${ASM:S/.o/.S/}
99
100SPSEUDO= ${PSEUDO:S/.o/.S/}
101
102SRCS+=	${SASM} ${SPSEUDO}
103
104SYM_MAPS+=	${LIBC_SRCTOP}/sys/Symbol.map
105
106# Generated files
107CLEANFILES+=	${SASM} ${SPSEUDO}
108
109.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
110    ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*}
111NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n'
112.else
113NOTE_GNU_STACK=''
114.endif
115
116${SASM}:
117	printf '#include "compat.h"\n' > ${.TARGET}
118	printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET}
119	printf  ${NOTE_GNU_STACK} >>${.TARGET}
120
121${SPSEUDO}:
122	printf '#include "compat.h"\n' > ${.TARGET}
123	printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \
124	    >> ${.TARGET}
125	printf ${NOTE_GNU_STACK} >>${.TARGET}
126
127MAN+=	abort2.2 \
128	accept.2 \
129	access.2 \
130	acct.2 \
131	adjtime.2 \
132	aio_cancel.2 \
133	aio_error.2 \
134	aio_fsync.2 \
135	aio_mlock.2 \
136	aio_read.2 \
137	aio_return.2 \
138	aio_suspend.2 \
139	aio_waitcomplete.2 \
140	aio_write.2 \
141	bind.2 \
142	bindat.2 \
143	brk.2 \
144	cap_enter.2 \
145	cap_fcntls_limit.2 \
146	cap_ioctls_limit.2 \
147	cap_rights_limit.2 \
148	chdir.2 \
149	chflags.2 \
150	chmod.2 \
151	chown.2 \
152	chroot.2 \
153	clock_gettime.2 \
154	close.2 \
155	closefrom.2 \
156	connect.2 \
157	connectat.2 \
158	cpuset.2 \
159	cpuset_getaffinity.2 \
160	dup.2 \
161	execve.2 \
162	_exit.2 \
163	extattr_get_file.2 \
164	fcntl.2 \
165	ffclock.2 \
166	fhopen.2 \
167	flock.2 \
168	fork.2 \
169	fsync.2 \
170	getdirentries.2 \
171	getdtablesize.2 \
172	getfh.2 \
173	getfsstat.2 \
174	getgid.2 \
175	getgroups.2 \
176	getitimer.2 \
177	getlogin.2 \
178	getloginclass.2 \
179	getpeername.2 \
180	getpgrp.2 \
181	getpid.2 \
182	getpriority.2 \
183	getrlimit.2 \
184	getrusage.2 \
185	getsid.2 \
186	getsockname.2 \
187	getsockopt.2 \
188	gettimeofday.2 \
189	getuid.2 \
190	intro.2 \
191	ioctl.2 \
192	issetugid.2 \
193	jail.2 \
194	kenv.2 \
195	kill.2 \
196	kldfind.2 \
197	kldfirstmod.2 \
198	kldload.2 \
199	kldnext.2 \
200	kldstat.2 \
201	kldsym.2 \
202	kldunload.2 \
203	kqueue.2 \
204	ktrace.2 \
205	link.2 \
206	lio_listio.2 \
207	listen.2 \
208	lseek.2 \
209	madvise.2 \
210	mincore.2 \
211	minherit.2 \
212	mkdir.2 \
213	mkfifo.2 \
214	mknod.2 \
215	mlock.2 \
216	mlockall.2 \
217	mmap.2 \
218	modfind.2 \
219	modnext.2 \
220	modstat.2 \
221	mount.2 \
222	mprotect.2 \
223	mq_close.2 \
224	mq_getattr.2 \
225	mq_notify.2 \
226	mq_open.2 \
227	mq_receive.2 \
228	mq_send.2 \
229	mq_setattr.2 \
230	msgctl.2 \
231	msgget.2 \
232	msgrcv.2 \
233	msgsnd.2 \
234	msync.2 \
235	munmap.2 \
236	nanosleep.2 \
237	nfssvc.2 \
238	ntp_adjtime.2 \
239	numa_getaffinity.2 \
240	open.2 \
241	pathconf.2 \
242	pdfork.2 \
243	pipe.2 \
244	poll.2 \
245	posix_fadvise.2 \
246	posix_fallocate.2 \
247	posix_openpt.2 \
248	procctl.2 \
249	profil.2 \
250	pselect.2 \
251	ptrace.2 \
252	quotactl.2 \
253	rctl_add_rule.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	thr_exit.2 \
311	thr_kill.2 \
312	thr_new.2 \
313	thr_self.2 \
314	thr_set_name.2 \
315	thr_suspend.2 \
316	thr_wake.2 \
317	timer_create.2 \
318	timer_delete.2 \
319	timer_settime.2 \
320	truncate.2 \
321	umask.2 \
322	undelete.2 \
323	unlink.2 \
324	utimensat.2 \
325	utimes.2 \
326	utrace.2 \
327	uuidgen.2 \
328	vfork.2 \
329	wait.2 \
330	write.2 \
331	_umtx_op.2
332
333MLINKS+=accept.2 accept4.2
334MLINKS+=access.2 eaccess.2 \
335	access.2 faccessat.2
336MLINKS+=brk.2 sbrk.2
337MLINKS+=cap_enter.2 cap_getmode.2
338MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
339MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
340MLINKS+=cap_rights_limit.2 cap_rights_get.2
341MLINKS+=chdir.2 fchdir.2
342MLINKS+=chflags.2 chflagsat.2 \
343	chflags.2 fchflags.2 \
344	chflags.2 lchflags.2
345MLINKS+=chmod.2 fchmod.2 \
346	chmod.2 fchmodat.2 \
347	chmod.2 lchmod.2
348MLINKS+=chown.2 fchown.2 \
349	chown.2 fchownat.2 \
350	chown.2 lchown.2
351MLINKS+=clock_gettime.2 clock_getres.2 \
352	clock_gettime.2 clock_settime.2
353MLINKS+=nanosleep.2 clock_nanosleep.2
354MLINKS+=cpuset.2 cpuset_getid.2 \
355	cpuset.2 cpuset_setid.2
356MLINKS+=cpuset_getaffinity.2 cpuset_setaffinity.2
357MLINKS+=dup.2 dup2.2
358MLINKS+=execve.2 fexecve.2
359MLINKS+=extattr_get_file.2 extattr.2 \
360	extattr_get_file.2 extattr_delete_fd.2 \
361	extattr_get_file.2 extattr_delete_file.2 \
362	extattr_get_file.2 extattr_delete_link.2 \
363	extattr_get_file.2 extattr_get_fd.2 \
364	extattr_get_file.2 extattr_get_link.2 \
365	extattr_get_file.2 extattr_list_fd.2 \
366	extattr_get_file.2 extattr_list_file.2 \
367	extattr_get_file.2 extattr_list_link.2 \
368	extattr_get_file.2 extattr_set_fd.2 \
369	extattr_get_file.2 extattr_set_file.2 \
370	extattr_get_file.2 extattr_set_link.2
371MLINKS+=ffclock.2 ffclock_getcounter.2 \
372	ffclock.2 ffclock_getestimate.2 \
373	ffclock.2 ffclock_setestimate.2
374MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
375MLINKS+=fsync.2 fdatasync.2
376MLINKS+=getdirentries.2 getdents.2
377MLINKS+=getfh.2 lgetfh.2
378MLINKS+=getgid.2 getegid.2
379MLINKS+=getitimer.2 setitimer.2
380MLINKS+=getlogin.2 getlogin_r.3
381MLINKS+=getlogin.2 setlogin.2
382MLINKS+=getloginclass.2 setloginclass.2
383MLINKS+=getpgrp.2 getpgid.2
384MLINKS+=getpid.2 getppid.2
385MLINKS+=getpriority.2 setpriority.2
386MLINKS+=getrlimit.2 setrlimit.2
387MLINKS+=getsockopt.2 setsockopt.2
388MLINKS+=gettimeofday.2 settimeofday.2
389MLINKS+=getuid.2 geteuid.2
390MLINKS+=intro.2 errno.2
391MLINKS+=jail.2 jail_attach.2 \
392	jail.2 jail_get.2 \
393	jail.2 jail_remove.2 \
394	jail.2 jail_set.2
395MLINKS+=kldunload.2 kldunloadf.2
396MLINKS+=kqueue.2 kevent.2 \
397	kqueue.2 EV_SET.3
398MLINKS+=link.2 linkat.2
399MLINKS+=madvise.2 posix_madvise.2
400MLINKS+=mkdir.2 mkdirat.2
401MLINKS+=mkfifo.2 mkfifoat.2
402MLINKS+=mknod.2 mknodat.2
403MLINKS+=mlock.2 munlock.2
404MLINKS+=mlockall.2 munlockall.2
405MLINKS+=modnext.2 modfnext.2
406MLINKS+=mount.2 nmount.2 \
407	mount.2 unmount.2
408MLINKS+=mq_receive.2 mq_timedreceive.2
409MLINKS+=mq_send.2 mq_timedsend.2
410MLINKS+=ntp_adjtime.2 ntp_gettime.2
411MLINKS+=numa_getaffinity.2 numa_setaffinity.2
412MLINKS+=open.2 openat.2
413MLINKS+=pathconf.2 fpathconf.2
414MLINKS+=pathconf.2 lpathconf.2
415MLINKS+=pdfork.2 pdgetpid.2\
416	pdfork.2 pdkill.2 \
417	pdfork.2 pdwait4.2
418MLINKS+=pipe.2 pipe2.2
419MLINKS+=poll.2 ppoll.2
420MLINKS+=rctl_add_rule.2 rctl_get_limits.2 \
421	rctl_add_rule.2 rctl_get_racct.2 \
422	rctl_add_rule.2 rctl_get_rules.2 \
423	rctl_add_rule.2 rctl_remove_rule.2
424MLINKS+=read.2 pread.2 \
425	read.2 preadv.2 \
426	read.2 readv.2
427MLINKS+=readlink.2 readlinkat.2
428MLINKS+=recv.2 recvfrom.2 \
429	recv.2 recvmsg.2
430MLINKS+=rename.2 renameat.2
431MLINKS+=rtprio.2 rtprio_thread.2
432.if !defined(NO_P1003_1B)
433MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \
434	sched_get_priority_max.2 sched_rr_get_interval.2
435MLINKS+=sched_setparam.2 sched_getparam.2
436MLINKS+=sched_setscheduler.2 sched_getscheduler.2
437.endif
438MLINKS+=select.2 FD_CLR.3 \
439	select.2 FD_ISSET.3 \
440	select.2 FD_SET.3 \
441	select.2 FD_ZERO.3
442MLINKS+=send.2 sendmsg.2 \
443	send.2 sendto.2
444MLINKS+=setpgid.2 setpgrp.2
445MLINKS+=setresuid.2 getresgid.2 \
446	setresuid.2 getresuid.2 \
447	setresuid.2 setresgid.2
448MLINKS+=setuid.2 setegid.2 \
449	setuid.2 seteuid.2 \
450	setuid.2 setgid.2
451MLINKS+=shmat.2 shmdt.2
452MLINKS+=shm_open.2 shm_unlink.2
453MLINKS+=sigwaitinfo.2 sigtimedwait.2
454MLINKS+=stat.2 fstat.2 \
455	stat.2 fstatat.2 \
456	stat.2 lstat.2
457MLINKS+=statfs.2 fstatfs.2
458MLINKS+=swapon.2 swapoff.2
459MLINKS+=symlink.2 symlinkat.2
460MLINKS+=syscall.2 __syscall.2
461MLINKS+=timer_settime.2 timer_getoverrun.2 \
462	timer_settime.2 timer_gettime.2
463MLINKS+=thr_kill.2 thr_kill2.2
464MLINKS+=truncate.2 ftruncate.2
465MLINKS+=unlink.2 unlinkat.2
466MLINKS+=utimensat.2 futimens.2
467MLINKS+=utimes.2 futimes.2 \
468	utimes.2 futimesat.2 \
469	utimes.2 lutimes.2
470MLINKS+=wait.2 wait3.2 \
471	wait.2 wait4.2 \
472	wait.2 waitpid.2 \
473	wait.2 waitid.2 \
474	wait.2 wait6.2
475MLINKS+=write.2 pwrite.2 \
476	write.2 pwritev.2 \
477	write.2 writev.2
478