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