Makefile.inc revision 1.55
1#	$OpenBSD: Makefile.inc,v 1.55 2002/08/05 15:31:12 art Exp $
2#	$NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $
3#	@(#)Makefile.inc	8.1 (Berkeley) 6/17/93
4
5# sys sources
6.PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/sys ${LIBCSRCDIR}/sys
7
8# for now, only arch's below have weak aliases enabled
9.if ${MACHINE_ARCH} != "i386" || ${ELF_TOOLCHAIN} == "yes"
10CFLAGS+=	-D_NO_WEAK_ALIASES
11.endif
12
13# modules with non-default implementations on at least one architecture:
14SRCS+=	Ovfork.S brk.S cerror.S exect.S fork.S rfork.S \
15	sbrk.S sigpending.S sigprocmask.S sigreturn.S \
16	sigsuspend.S syscall.S
17
18LSRCS+=	Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c \
19	Lint_sbrk.c \
20	Lint_sigpending.c Lint_sigprocmask.c Lint_sigreturn.c \
21	Lint_sigsuspend.c Lint_syscall.c
22DPSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c \
23	Lint_sbrk.c \
24	Lint_sigpending.c Lint_sigprocmask.c Lint_sigreturn.c \
25	Lint_sigsuspend.c Lint_syscall.c
26
27# glue to provide compatibility between GCC 1.X and 2.X and for compat
28# with old syscall interfaces.
29SRCS+=	ftruncate.c lseek.c mmap.c ptrace.c semctl.c truncate.c \
30	timer_create.c timer_delete.c timer_getoverrun.c timer_gettime.c \
31	timer_settime.c pread.c preadv.c pwrite.c pwritev.c
32
33# modules with default implementations on all architectures:
34ASM=	accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o chmod.o \
35	chown.o chroot.o clock_gettime.o clock_settime.o clock_getres.o \
36	close.o connect.o dup.o dup2.o execve.o fchdir.o \
37	fchflags.o fchmod.o fchown.o fcntl.o fhopen.o fhstat.o fhstatfs.o \
38	flock.o fpathconf.o fstat.o \
39	fstatfs.o fsync.o futimes.o getdirentries.o getegid.o geteuid.o \
40	getfh.o getfsstat.o getgid.o getgroups.o getitimer.o getpeereid.o \
41	getpeername.o \
42	getpgid.o \
43	getpgrp.o getpid.o getppid.o getpriority.o getrlimit.o getrusage.o \
44	getsid.o \
45	getsockname.o getsockopt.o gettimeofday.o getuid.o issetugid.o \
46	ioctl.o kill.o kevent.o kqueue.o \
47	ktrace.o lchown.o lfs_bmapv.o lfs_markv.o lfs_segclean.o lfs_segwait.o \
48	link.o listen.o lstat.o madvise.o mincore.o minherit.o mkdir.o \
49	mkfifo.o mknod.o mlock.o mlockall.o \
50	mount.o mprotect.o msgctl.o msgget.o msgrcv.o msgsnd.o msync.o \
51	munlock.o munlockall.o munmap.o nanosleep.o nfssvc.o \
52	open.o pathconf.o pipe.o poll.o profil.o quotactl.o \
53	read.o readlink.o readv.o reboot.o recvfrom.o recvmsg.o rename.o \
54	revoke.o rmdir.o select.o semget.o semop.o sendmsg.o sendto.o \
55	setegid.o seteuid.o setgid.o setgroups.o setitimer.o setpgid.o \
56	setpriority.o setrlimit.o setsid.o setsockopt.o settimeofday.o \
57	setuid.o shmat.o shmctl.o shmdt.o shmget.o shutdown.o sigaction.o \
58	sigaltstack.o socket.o socketpair.o stat.o statfs.o swapon.o swapctl.o \
59	symlink.o sync.o sysarch.o umask.o undelete.o unlink.o unmount.o \
60	utimes.o vadvise.o wait4.o write.o writev.o xfspioctl.o __semctl.o \
61	__syscall.o __sysctl.o
62
63ASM+=	extattrctl.o extattr_set_file.o extattr_get_file.o \
64	extattr_delete_file.o extattr_set_fd.o extattr_get_fd.o \
65	extattr_delete_fd.o
66
67GASM=	${ASM:.o=.go}
68PASM=	${ASM:.o=.po}
69SASM=	${ASM:.o=.so}
70
71PSEUDO=	_getlogin.o _setlogin.o _ptrace.o
72GPSEUDO=${PSEUDO:.o=.go}
73PPSEUDO=${PSEUDO:.o=.po}
74SPSEUDO=${PSEUDO:.o=.so}
75
76PSEUDO_NOERR=	_exit.o
77GPSEUDO_NOERR=${PSEUDO_NOERR:.o=.go}
78PPSEUDO_NOERR=${PSEUDO_NOERR:.o=.po}
79SPSEUDO_NOERR=${PSEUDO_NOERR:.o=.so}
80
81OBJS+=	${ASM} ${PSEUDO} ${PSEUDO_NOERR}
82
83${GASM}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
84	@echo creating ${.TARGET}
85	@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
86	    ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
87	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
88	@rm -f ${.TARGET}.o
89
90${PASM}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
91	@echo creating ${.TARGET}
92	@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
93	    ${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
94	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
95	@rm -f ${.TARGET}.o
96
97.if (${MACHINE_ARCH} != "mips")
98${SASM}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
99	@echo creating ${.TARGET}
100	@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
101	    ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | \
102	    ${AS} ${ASPICFLAG} -o ${.TARGET}
103.else
104${SASM}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
105	@echo creating ${.TARGET}
106	@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
107	    ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}
108.endif
109
110${ASM}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
111	@echo creating ${.TARGET}
112	@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
113	    ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
114	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
115	@rm -f ${.TARGET}.o
116
117${GPSEUDO}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
118	@echo creating ${.TARGET}
119	@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
120	    ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
121	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
122	@rm -f ${.TARGET}.o
123
124${PPSEUDO}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
125	@echo creating ${.TARGET}
126	@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
127	    ${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
128	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
129	@rm -f ${.TARGET}.o
130
131.if (${MACHINE_ARCH} != "mips")
132${SPSEUDO}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
133	@echo creating ${.TARGET}
134	@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
135	    ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | \
136	    ${AS} ${ASPICFLAG} -o ${.TARGET}
137.else
138${SPSEUDO}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
139	@echo creating ${.TARGET}
140	@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
141	    ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}
142.endif
143
144${PSEUDO}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
145	@echo creating ${.TARGET}
146	@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
147	    ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
148	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
149	@rm -f ${.TARGET}.o
150
151${GPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
152	@echo creating ${.TARGET}
153	@printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
154	    ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
155	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
156	@rm -f ${.TARGET}.o
157
158${PPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
159	@echo creating ${.TARGET}
160	@printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
161	    ${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
162	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
163	@rm -f ${.TARGET}.o
164
165.if (${MACHINE_ARCH} != "mips")
166${SPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
167	@echo creating ${.TARGET}
168	@printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
169	    ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | \
170	    ${AS} ${ASPICFLAG} -o ${.TARGET}
171.else
172${SPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
173	@echo creating ${.TARGET}
174	@printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
175	    ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}
176.endif
177
178${PSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
179	@echo creating ${.TARGET}
180	@printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
181	    ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
182	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
183	@rm -f ${.TARGET}.o
184
185# Lint stubs for all automatically-generated assembly stubs (GENERATED)
186#LSRCS+=	LintSysNormal.c LintSysNoerr.c LintSysPseudoNoerr.c
187#DPSRCS+= LintSysNormal.c LintSysNoerr.c LintSysPseudoNoerr.c
188LSRCS+=	LintSysNormal.c
189DPSRCS+= LintSysNormal.c
190
191CLEANFILES+= LintSysNormal.c LintSysNoerr.c LintSysPseudo.c
192
193LintSysNormal.c: ${LIBCSRCDIR}/sys/makelintstub.sh \
194    ${DESTDIR}/usr/include/sys/syscall.h
195	@echo creating ${.TARGET}
196	@sh ${LIBCSRCDIR}/sys/makelintstub.sh -o ${.TARGET} \
197	    -s ${DESTDIR}/usr/include/sys/syscall.h ${ASM}
198
199LintSysNoerr.c: ${LIBCSRCDIR}/sys/makelintstub.sh \
200    ${DESTDIR}/usr/include/sys/syscall.h
201	@echo creating ${.TARGET}
202	@sh ${LIBCSRCDIR}/sys/makelintstub.sh -o ${.TARGET} -n \
203	    -s ${DESTDIR}/usr/include/sys/syscall.h ${NOERR}
204
205LintSysPseudoNoerr.c: ${LIBCSRCDIR}/sys/makelintstub.sh \
206    ${DESTDIR}/usr/include/sys/syscall.h
207	@echo creating ${.TARGET}
208	@sh ${LIBCSRCDIR}/sys/makelintstub.sh -o ${.TARGET} -p \
209	    -s ${DESTDIR}/usr/include/sys/syscall.h ${PSEUDONOERR}
210
211MAN+=	accept.2 access.2 acct.2 adjtime.2 bind.2 brk.2 chdir.2 chflags.2 \
212	chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 connect.2 dup.2 \
213	execve.2 _exit.2 fcntl.2 fhopen.2 \
214	flock.2 fork.2 fsync.2 getdirentries.2 \
215	getfh.2 getfsstat.2 getgid.2 getgroups.2 getitimer.2 getlogin.2 \
216	getpeername.2 getpeereid.2 getpgrp.2 \
217	getpid.2 getpriority.2 getrlimit.2 getrusage.2 getsid.2 getsockname.2 \
218	getsockopt.2 gettimeofday.2 getuid.2 intro.2 issetugid.2 ioctl.2 \
219	kill.2 kqueue.2 ktrace.2 link.2 \
220	listen.2 lseek.2 mkdir.2 mkfifo.2 mknod.2 madvise.2 mincore.2 \
221	minherit.2 mlock.2 mlockall.2 \
222	mmap.2 mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \
223	nfssvc.2 open.2 pathconf.2 \
224	pipe.2 profil.2 poll.2 ptrace.2 quotactl.2 read.2 readlink.2 reboot.2 \
225	recv.2 rename.2 revoke.2 rfork.2 rmdir.2 select.2 send.2 setgroups.2 \
226	setpgid.2 setsid.2 setuid.2 shutdown.2 sigaction.2 sigaltstack.2 \
227	sigpending.2 sigprocmask.2 sigreturn.2 sigstack.2 sigsuspend.2 \
228	socket.2 socketpair.2 stat.2 statfs.2 swapctl.2 symlink.2 sync.2 \
229	sysarch.2 syscall.2 truncate.2 umask.2 unlink.2 utimes.2 vfork.2 \
230	wait.2 write.2
231
232MAN+=	extattr_get_file.2
233MLINKS+=extattr_get_file.2 extattr_set_file.2 \
234	extattr_get_file.2 extattr_delete_file.2 \
235	extattr_get_file.2 extattr_get_fd.2 \
236	extattr_get_file.2 extattr_set_fd.2 \
237	extattr_get_file.2 extattr_delete_fd.2 \
238	extattr_get_file.2 extattr.2
239
240MAN+=	msgctl.2 shmctl.2 shmat.2 semop.2 semget.2 semctl.2 msgsnd.2 msgrcv.2 \
241	msgget.2 shmget.2
242
243MLINKS+=brk.2 sbrk.2
244MLINKS+=dup.2 dup2.2
245MLINKS+=chdir.2 fchdir.2
246MLINKS+=chflags.2 fchflags.2
247MLINKS+=chmod.2 fchmod.2
248MLINKS+=chown.2 fchown.2
249MLINKS+=chown.2 lchown.2
250MLINKS+=clock_gettime.2 clock_settime.2
251MLINKS+=clock_gettime.2 clock_getres.2
252MLINKS+=execve.2 exect.2
253MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
254MLINKS+=getgid.2 getegid.2
255MLINKS+=getitimer.2 setitimer.2
256MLINKS+=getitimer.2 timeradd.3
257MLINKS+=getitimer.2 timerclear.3
258MLINKS+=getitimer.2 timercmp.3
259MLINKS+=getitimer.2 timerisset.3
260MLINKS+=getitimer.2 timersub.3
261MLINKS+=getlogin.2 setlogin.2
262MLINKS+=getpgrp.2 getpgid.2
263MLINKS+=getpid.2 getppid.2
264MLINKS+=getpriority.2 setpriority.2
265MLINKS+=getrlimit.2 setrlimit.2
266MLINKS+=getsockopt.2 setsockopt.2
267MLINKS+=gettimeofday.2 settimeofday.2
268MLINKS+=getuid.2 geteuid.2
269MLINKS+=kqueue.2 kevent.2
270MLINKS+=intro.2 errno.2
271MLINKS+=mlock.2 munlock.2
272MLINKS+=mlockall.2 munlockall.2
273MLINKS+=mount.2 unmount.2
274MLINKS+=pathconf.2 fpathconf.2
275MLINKS+=read.2 readv.2 read.2 pread.2 read.2 preadv.2
276MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2
277MLINKS+=send.2 sendmsg.2 send.2 sendto.2
278MLINKS+=setpgid.2 setpgrp.2
279MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2
280MLINKS+=shmat.2 shmdt.2
281MLINKS+=stat.2 fstat.2 stat.2 lstat.2
282MLINKS+=statfs.2 fstatfs.2
283MLINKS+=syscall.2 __syscall.2
284MLINKS+=truncate.2 ftruncate.2
285MLINKS+=utimes.2 futimes.2
286MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2
287MLINKS+=write.2 writev.2 write.2 pwrite.2 write.2 pwritev.2
288MLINKS+=select.2 FD_SET.3 select.2 FD_CLR.3
289MLINKS+=select.2 FD_ISSET.3 select.2 FD_ZERO.3
290