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