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