]>
Commit | Line | Data |
---|---|---|
5b2abdfb A |
1 | # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 |
2 | # $FreeBSD: src/lsys/Makefile.inc,v 1.91 2001/09/21 21:35:22 rwatson Exp $ | |
3 | ||
5b2abdfb A |
4 | # Include machine dependent definitions. |
5 | # | |
6 | # MDASM names override the default syscall names in MIASM. | |
7 | # NOASM will prevent the default syscall code from being generated. | |
8 | # | |
224c7076 | 9 | .ifnmake autopatch |
5b2abdfb A |
10 | .if exists(${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc) |
11 | .include "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc" | |
12 | .endif | |
224c7076 | 13 | .endif # !autopatch |
5b2abdfb | 14 | |
59e0d9fe A |
15 | # sys sources |
16 | .PATH: ${.CURDIR}/sys | |
17 | ||
18 | # Include the generated makefile containing the *complete* list | |
19 | # of syscall names in MIASM. | |
20 | #.include "${.CURDIR}/../../sys/sys/syscall.mk" | |
21 | ||
5b2abdfb | 22 | # Sources common to both syscall interfaces: |
5b2abdfb | 23 | |
9385eb3d | 24 | # 3375657: patches for sem_open() sem_unlink() shm_open() shm_unlink() |
224c7076 A |
25 | MISRCS+= chmod.c chmodx_np.c crt_externs.c \ |
26 | errno.c fchmod.c fix-3375657.c \ | |
27 | getiopolicy_np.c getrlimit.c gettimeofday.c \ | |
28 | kill.c __libc_init.c \ | |
29 | mmap.c \ | |
30 | openx_np.c \ | |
31 | posix_spawn.c \ | |
32 | select.c sem_open.c sem_unlink.c semctl.c \ | |
33 | setrlimit.c \ | |
34 | shm_open.c shm_unlink.c sigaction.c sigcatch.c sigsuspend.c \ | |
35 | sigtramp.c statx_np.c \ | |
36 | umaskx_np.c | |
5b2abdfb | 37 | |
224c7076 A |
38 | .if (${MACHINE_ARCH} != ppc) |
39 | .if (${MACHINE_ARCH} != i386) | |
40 | MISRCS+= context-stubs.c | |
41 | .endif | |
42 | .endif | |
43 | ||
44 | .ifdef LP64 | |
45 | MISRCS+= fcntl.c ioctl.c | |
46 | PRE1050SRCS+= select.c | |
47 | .endif | |
59e0d9fe | 48 | |
eb1cde05 A |
49 | .include "Makefile.obsd_begin" |
50 | OBSDMISRCS= stack_protector.c | |
51 | .include "Makefile.obsd_end" | |
52 | ||
224c7076 A |
53 | .for _src in sem_open.c sem_unlink.c shm_open.c shm_unlink.c fix-3375657.c |
54 | CFLAGS-${_src} += -D__APPLE_PR3375657_HACK__ | |
55 | .endfor | |
56 | ||
57 | INODE32SRCS += statx_np.c | |
58 | ||
59 | CANCELABLESRCS += select.c sigsuspend.c | |
60 | ||
61 | .ifdef LP64 | |
62 | CANCELABLESRCS+= fcntl.c | |
63 | .endif | |
64 | ||
65 | LEGACYSRCS += accept.c bind.c connect.c \ | |
66 | getattrlist.c getpeername.c getsockname.c \ | |
67 | kill.c lchown.c listen.c \ | |
68 | mprotect.c msgctl.c msync.c munmap.c \ | |
69 | open.c \ | |
70 | recvfrom.c recvmsg.c \ | |
71 | select.c semctl.c sendmsg.c sendto.c setattrlist.c \ | |
72 | shmctl.c sigsuspend.c socketpair.c | |
73 | ||
74 | # we need to create open.h, which just contains a definition for O_NOCTTY | |
75 | open.do open.o open.po open.So: open.h | |
76 | open.h : | |
77 | ${CC} -E -dD ${CFLAGS} -include fcntl.h -x c /dev/null | grep O_NOCTTY > ${.TARGET} | |
78 | ||
79 | .for _src in msgctl.c semctl.c shmctl.c | |
80 | CFLAGS-${_src} += -DKERNEL | |
81 | .endfor | |
82 | ||
83 | # sigtramp.c can only compile with __DARWIN_UNIX03=0 (for ppc64) because | |
84 | # the structure field names are renamed with __ prefix when __DARWIN_UNIX03=1. | |
85 | # If sigtramp.c ever needs to build variant, this will have to be fix properly | |
86 | CFLAGS-sigtramp.c = -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0 | |
87 | ||
88 | # set the LIBC_ALIAS_* macros so we can decorate the symbol independent | |
89 | # of other macro settings | |
90 | CFLAGS-accept.c += -DLIBC_ALIAS_ACCEPT | |
91 | #CFLAGS-aio_suspend.c += -DLIBC_ALIAS_AIO_SUSPEND | |
92 | CFLAGS-bind.c += -DLIBC_ALIAS_BIND | |
93 | CFLAGS-chmod.c += -DLIBC_ALIAS_CHMOD | |
94 | #CFLAGS-close.c += -DLIBC_ALIAS_CLOSE | |
95 | CFLAGS-connect.c += -DLIBC_ALIAS_CONNECT | |
96 | CFLAGS-fchmod.c += -DLIBC_ALIAS_FCHMOD | |
97 | CFLAGS-fcntl.c += -DLIBC_ALIAS_FCNTL | |
98 | #CFLAGS-fsync.c += -DLIBC_ALIAS_FSYNC | |
99 | CFLAGS-getattrlist.c += -DLIBC_ALIAS_GETATTRLIST | |
100 | CFLAGS-getpeername.c += -DLIBC_ALIAS_GETPEERNAME | |
101 | CFLAGS-getrlimit.c += -DLIBC_ALIAS_GETRLIMIT | |
102 | CFLAGS-getsockname.c += -DLIBC_ALIAS_GETSOCKNAME | |
103 | CFLAGS-kill.c += -DLIBC_ALIAS_KILL | |
104 | CFLAGS-lchmod.c += -DLIBC_ALIAS_LCHMOD | |
105 | CFLAGS-listen.c += -DLIBC_ALIAS_LISTEN | |
106 | CFLAGS-mmap.c += -DLIBC_ALIAS_MMAP | |
107 | CFLAGS-mprotect.c += -DLIBC_ALIAS_MPROTECT | |
108 | CFLAGS-msgctl.c += -DLIBC_ALIAS_MSGCTL | |
109 | #CFLAGS-msgrcv.c += -DLIBC_ALIAS_MSGRCV | |
110 | #CFLAGS-msgsnd.c += -DLIBC_ALIAS_MSGSND | |
111 | CFLAGS-msync.c += -DLIBC_ALIAS_MSYNC | |
112 | CFLAGS-munmap.c += -DLIBC_ALIAS_MUNMAP | |
113 | CFLAGS-open.c += -DLIBC_ALIAS_OPEN | |
114 | #CFLAGS-poll.c += -DLIBC_ALIAS_POLL | |
115 | #CFLAGS-pread.c += -DLIBC_ALIAS_PREAD | |
116 | #CFLAGS-pwrite.c += -DLIBC_ALIAS_PWRITE | |
117 | #CFLAGS-read.c += -DLIBC_ALIAS_READ | |
118 | #CFLAGS-readv.c += -DLIBC_ALIAS_READV | |
119 | CFLAGS-recvfrom.c += -DLIBC_ALIAS_RECVFROM | |
120 | CFLAGS-recvmsg.c += -DLIBC_ALIAS_RECVMSG | |
121 | CFLAGS-select.c += -DLIBC_ALIAS_SELECT | |
122 | #CFLAGS-sem_wait.c += -DLIBC_ALIAS_SEM_WAIT | |
123 | CFLAGS-semctl.c += -DLIBC_ALIAS_SEMCTL | |
124 | CFLAGS-sendmsg.c += -DLIBC_ALIAS_SENDMSG | |
125 | CFLAGS-sendto.c += -DLIBC_ALIAS_SENDTO | |
126 | CFLAGS-setattrlist.c += -DLIBC_ALIAS_SETATTRLIST | |
127 | CFLAGS-setrlimit.c += -DLIBC_ALIAS_SETRLIMIT | |
128 | CFLAGS-shmctl.c += -DLIBC_ALIAS_SHMCTL | |
129 | CFLAGS-sigsuspend.c += -DLIBC_ALIAS_SIGSUSPEND | |
130 | CFLAGS-socketpair.c += -DLIBC_ALIAS_SOCKETPAIR | |
131 | #CFLAGS-waitid.c += -DLIBC_ALIAS_WAITID | |
132 | #CFLAGS-write.c += -DLIBC_ALIAS_WRITE | |
133 | #CFLAGS-writev.c += -DLIBC_ALIAS_WRITEV | |
3d9156a7 | 134 | |
5b2abdfb A |
135 | # Add machine dependent asm sources: |
136 | SRCS+=${MDASM} | |
137 | ||
138 | # Look though the complete list of syscalls (MIASM) for names that are | |
139 | # not defined with machine dependent implementations (MDASM) and are | |
140 | # not declared for no generation of default code (NOASM). Add each | |
141 | # syscall that satisfies these conditions to the ASM list. | |
142 | .for _asm in ${MIASM} | |
143 | .if (${MDASM:R:M${_asm:R}} == "") | |
144 | .if (${NOASM:R:M${_asm:R}} == "") | |
145 | ASM+=$(_asm) | |
146 | .endif | |
147 | .endif | |
148 | .endfor | |
149 | ||
150 | OBJS+= ${ASM} ${PSEUDO} | |
151 | ||
152 | SASM= ${ASM:S/.o/.S/} | |
153 | ||
154 | SPSEUDO= ${PSEUDO:S/.o/.S/} | |
155 | ||
156 | SRCS+= ${SASM} ${SPSEUDO} | |
157 | ||
158 | # Generated files | |
159 | CLEANFILES+= ${SASM} ${SPSEUDO} | |
160 | ||
161 | ${SASM}: | |
224c7076 | 162 | printf '#include <SYS.h>\nRSYSCALL(${.PREFIX})\n' > ${.TARGET} |
5b2abdfb A |
163 | |
164 | ${SPSEUDO}: | |
224c7076 | 165 | printf '#include <SYS.h>\nPSEUDO(${.PREFIX:S/_//})\n' \ |
5b2abdfb A |
166 | > ${.TARGET} |
167 | ||
224c7076 A |
168 | COPYFILES+= ${.CURDIR}/sys/libc.syscall |
169 | ||
5b2abdfb A |
170 | .if ${LIB} == "c" |
171 | MAN2+= pthread_kill.2 pthread_sigmask.2 \ | |
224c7076 | 172 | sem_close.2 sem_open.2 sem_post.2 \ |
5b2abdfb A |
173 | sem_unlink.2 sem_wait.2 shm_open.2 shm_unlink.2 \ |
174 | sigwait.2 getdtablesize.2 setreuid.2 setregid.2 \ | |
224c7076 A |
175 | nanosleep.2 undelete.2 |
176 | MAN3+= atomic.3 barrier.3 getiopolicy_np.3 spinlock.3 cache.3 | |
59e0d9fe | 177 | MLINKS+= atomic.3 OSAtomicAdd32.3 |
224c7076 | 178 | MLINKS+= atomic.3 OSAtomicAdd32Barrier.3 |
59e0d9fe | 179 | MLINKS+= atomic.3 OSAtomicAdd64.3 |
224c7076 A |
180 | MLINKS+= atomic.3 OSAtomicAdd64Barrier.3 |
181 | MLINKS+= atomic.3 OSAtomicAnd32.3 | |
182 | MLINKS+= atomic.3 OSAtomicAnd32Barrier.3 | |
183 | MLINKS+= atomic.3 OSAtomicAnd32Orig.3 | |
184 | MLINKS+= atomic.3 OSAtomicAnd32OrigBarrier.3 | |
59e0d9fe | 185 | MLINKS+= atomic.3 OSAtomicCompareAndSwap32.3 |
224c7076 | 186 | MLINKS+= atomic.3 OSAtomicCompareAndSwap32Barrier.3 |
59e0d9fe | 187 | MLINKS+= atomic.3 OSAtomicCompareAndSwap64.3 |
224c7076 A |
188 | MLINKS+= atomic.3 OSAtomicCompareAndSwap64Barrier.3 |
189 | MLINKS+= atomic.3 OSAtomicCompareAndSwapInt.3 | |
190 | MLINKS+= atomic.3 OSAtomicCompareAndSwapIntBarrier.3 | |
191 | MLINKS+= atomic.3 OSAtomicCompareAndSwapLong.3 | |
192 | MLINKS+= atomic.3 OSAtomicCompareAndSwapLongBarrier.3 | |
193 | MLINKS+= atomic.3 OSAtomicCompareAndSwapPtr.3 | |
194 | MLINKS+= atomic.3 OSAtomicCompareAndSwapPtrBarrier.3 | |
195 | MLINKS+= atomic.3 OSAtomicDecrement32.3 | |
196 | MLINKS+= atomic.3 OSAtomicDecrement32Barrier.3 | |
197 | MLINKS+= atomic.3 OSAtomicDecrement64.3 | |
198 | MLINKS+= atomic.3 OSAtomicDecrement64Barrier.3 | |
199 | MLINKS+= atomic.3 OSAtomicDequeue.3 | |
200 | MLINKS+= atomic.3 OSAtomicEnqueue.3 | |
201 | MLINKS+= atomic.3 OSAtomicIncrement32.3 | |
202 | MLINKS+= atomic.3 OSAtomicIncrement32Barrier.3 | |
203 | MLINKS+= atomic.3 OSAtomicIncrement64.3 | |
204 | MLINKS+= atomic.3 OSAtomicIncrement64Barrier.3 | |
205 | MLINKS+= atomic.3 OSAtomicOr32.3 | |
206 | MLINKS+= atomic.3 OSAtomicOr32Barrier.3 | |
207 | MLINKS+= atomic.3 OSAtomicOr32Orig.3 | |
208 | MLINKS+= atomic.3 OSAtomicOr32OrigBarrier.3 | |
59e0d9fe | 209 | MLINKS+= atomic.3 OSAtomicTestAndClear.3 |
224c7076 A |
210 | MLINKS+= atomic.3 OSAtomicTestAndClearBarrier.3 |
211 | MLINKS+= atomic.3 OSAtomicTestAndSet.3 | |
212 | MLINKS+= atomic.3 OSAtomicTestAndSetBarrier.3 | |
213 | MLINKS+= atomic.3 OSAtomicXor32.3 | |
214 | MLINKS+= atomic.3 OSAtomicXor32Barrier.3 | |
215 | MLINKS+= atomic.3 OSAtomicXor32Orig.3 | |
216 | MLINKS+= atomic.3 OSAtomicXor32OrigBarrier.3 | |
59e0d9fe | 217 | MLINKS+= barrier.3 OSMemoryBarrier.3 |
224c7076 A |
218 | |
219 | MLINKS+= getiopolicy_np.3 setiopolicy_np.3 | |
220 | ||
221 | MLINKS+= sem_wait.2 sem_trywait.2 | |
222 | MLINKS+= cache.3 sys_cache_control.3 | |
223 | MLINKS+= cache.3 sys_icache_invalidate.3 | |
224 | MLINKS+= cache.3 sys_dcache_flush.3 | |
225 | ||
226 | MLINKS+= spinlock.3 OSSpinLockLock.3 \ | |
227 | spinlock.3 OSSpinLockTry.3 \ | |
228 | spinlock.3 OSSpinLockUnlock.3 | |
59e0d9fe | 229 | |
5b2abdfb A |
230 | #MAN+= _exit.2 accept.2 access.2 acct.2 adjtime.2 \ |
231 | # aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ | |
232 | # aio_suspend.2 aio_waitcomplete.2 aio_write.2 \ | |
233 | # bind.2 brk.2 chdir.2 chflags.2 \ | |
234 | # chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \ | |
235 | # connect.2 dup.2 execve.2 extattr_get_file.2 \ | |
236 | # fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ | |
237 | # getdirentries.2 getdtablesize.2 \ | |
238 | # getfh.2 getfsstat.2 getgid.2 getgroups.2 getitimer.2 getlogin.2 \ | |
239 | # getpeername.2 getpgrp.2 getpid.2 getpriority.2 getrlimit.2 \ | |
240 | # getrusage.2 getsid.2 getsockname.2 \ | |
241 | # getsockopt.2 gettimeofday.2 getuid.2 \ | |
242 | # intro.2 ioctl.2 issetugid.2 jail.2 kill.2 \ | |
243 | # kldfind.2 kldfirstmod.2 kldload.2 kldnext.2 kldstat.2 kldsym.2 \ | |
224c7076 | 244 | # kldunload.2 kqueue.2 link.2 listen.2 lseek.2 \ |
5b2abdfb A |
245 | # madvise.2 mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 mmap.2 \ |
246 | # modfind.2 modnext.2 modstat.2 \ | |
247 | # mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \ | |
248 | # nfssvc.2 open.2 pathconf.2 pipe.2 poll.2 profil.2 ptrace.2 quotactl.2 \ | |
249 | # read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ | |
250 | # rtprio.2 select.2 semctl.2 semget.2 semop.2 send.2 sendfile.2 \ | |
251 | # setgroups.2 setpgid.2 setregid.2 setresuid.2 setreuid.2 setsid.2 \ | |
252 | # setuid.2 shmat.2 shmctl.2 shmget.2 shutdown.2 \ | |
253 | # sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 sigreturn.2 \ | |
254 | # sigstack.2 sigsuspend.2 socket.2 socketpair.2 stat.2 statfs.2 \ | |
255 | # swapon.2 symlink.2 sync.2 sysarch.2 syscall.2 \ | |
256 | # truncate.2 umask.2 undelete.2 \ | |
257 | # unlink.2 utimes.2 vfork.2 wait.2 write.2 | |
258 | #.if !defined(NO_P1003_1B) | |
259 | #MAN+= sched_get_priority_max.2 sched_setparam.2 \ | |
260 | # sched_setscheduler.2 sched_yield.2 | |
261 | #.endif | |
262 | ||
263 | #MLINKS+=access.2 eaccess.2 | |
264 | #MLINKS+=brk.2 sbrk.2 | |
265 | #MLINKS+=chdir.2 fchdir.2 | |
266 | #MLINKS+=chflags.2 fchflags.2 | |
267 | #MLINKS+=chmod.2 fchmod.2 chmod.2 lchmod.2 | |
268 | #MLINKS+=chown.2 fchown.2 chown.2 lchown.2 | |
269 | #MLINKS+=clock_gettime.2 clock_getres.2 clock_gettime.2 clock_settime.2 | |
270 | #MLINKS+=dup.2 dup2.2 | |
271 | #MLINKS+=extattr_get_file.2 extattr_set_file.2 \ | |
272 | # extattr_get_file.2 extattr_delete_file.2 \ | |
273 | # extattr_get_file.2 extattr_get_fd.2 \ | |
274 | # extattr_get_file.2 extattr_set_fd.2 \ | |
275 | # extattr_get_file.2 extattr_delete_fd.2 \ | |
276 | # extattr_get_file.2 extattr.2 | |
277 | #MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 | |
278 | #MLINKS+=getdirentries.2 getdents.2 | |
279 | #MLINKS+=getgid.2 getegid.2 | |
280 | #MLINKS+=getitimer.2 setitimer.2 | |
281 | #MLINKS+=getlogin.2 getlogin_r.3 | |
282 | #MLINKS+=getlogin.2 setlogin.2 | |
283 | #MLINKS+=getpgrp.2 getpgid.2 | |
284 | #MLINKS+=getpid.2 getppid.2 | |
285 | #MLINKS+=getpriority.2 setpriority.2 | |
286 | #MLINKS+=getrlimit.2 setrlimit.2 | |
287 | #MLINKS+=getsockopt.2 setsockopt.2 | |
288 | #MLINKS+=gettimeofday.2 settimeofday.2 | |
289 | #MLINKS+=getuid.2 geteuid.2 | |
290 | #MLINKS+=intro.2 errno.2 | |
291 | #MLINKS+=kqueue.2 kevent.2 | |
292 | #MLINKS+=mlock.2 munlock.2 | |
293 | #MLINKS+=modnext.2 modfnext.2 | |
294 | #MLINKS+=mount.2 unmount.2 | |
295 | #MLINKS+=pathconf.2 fpathconf.2 | |
296 | #MLINKS+=read.2 pread.2 read.2 readv.2 | |
297 | #MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2 | |
298 | #MLINKS+=send.2 sendmsg.2 send.2 sendto.2 | |
299 | #MLINKS+=setpgid.2 setpgrp.2 | |
300 | #MLINKS+=setresuid.2 setresgid.2 setresuid.2 getresuid.2 setresuid.2 getresgid.2 | |
301 | #MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2 | |
302 | #MLINKS+=shmat.2 shmdt.2 | |
303 | #MLINKS+=stat.2 fstat.2 stat.2 lstat.2 | |
304 | #MLINKS+=statfs.2 fstatfs.2 | |
305 | #MLINKS+=syscall.2 __syscall.2 | |
306 | #MLINKS+=truncate.2 ftruncate.2 | |
307 | #MLINKS+=utimes.2 futimes.2 utimes.2 lutimes.2 | |
308 | #MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 | |
309 | #MLINKS+=write.2 pwrite.2 write.2 writev.2 | |
310 | #.if !defined(NO_P1003_1B) | |
311 | #MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \ | |
312 | # sched_get_priority_max.2 sched_rr_get_interval.2 | |
313 | #MLINKS+=sched_setparam.2 sched_getparam.2 | |
314 | #MLINKS+=sched_setscheduler.2 sched_getscheduler.2 | |
315 | #.endif | |
316 | .endif |