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