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