Annotation of src/include/Makefile, Revision 1.104
1.104 ! deraadt 1: # $OpenBSD: Makefile,v 1.103 2002/05/08 19:39:24 espie Exp $
1.8 deraadt 2: # $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
1.1 deraadt 3:
4: # @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
5:
6: # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
7: # links.
8:
9: # Missing: mp.h
10:
1.87 millert 11: FILES= a.out.h ar.h assert.h bitstring.h blf.h bm.h bsd_auth.h cast.h cpio.h \
1.82 millert 12: ctype.h curses.h db.h dbm.h des.h dirent.h disktab.h elf_abi.h err.h \
1.86 hugh 13: fnmatch.h fstab.h fts.h glob.h grp.h ifaddrs.h inttypes.h \
1.82 millert 14: iso646.h kvm.h langinfo.h libgen.h limits.h locale.h login_cap.h \
15: malloc.h math.h md4.h md5.h memory.h mpool.h ndbm.h netdb.h netgroup.h \
1.89 espie 16: nlist.h nl_types.h ohash.h olf_abi.h paths.h poll.h pwd.h \
17: ranlib.h re_comp.h \
1.87 millert 18: readpassphrase.h regex.h resolv.h rmd160.h search.h setjmp.h sgtty.h \
19: sha1.h skipjack.h signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h \
20: string.h strings.h struct.h sysexits.h tar.h time.h ttyent.h tzfile.h \
21: unistd.h utime.h utmp.h vis.h
1.8 deraadt 22:
1.102 fgsch 23: .if (${MACHINE_ARCH} != "powerpc") && (${MACHINE_ARCH} != "sparc64")
1.8 deraadt 24: FILES+= dlfcn.h link.h
1.86 hugh 25: .endif
26:
27: .if (${MACHINE_ARCH} != "vax")
28: FILES+= ieeefp.h
1.8 deraadt 29: .endif
1.1 deraadt 30:
31: MFILES= float.h frame.h stdarg.h varargs.h
32: LFILES= errno.h fcntl.h syslog.h termios.h
1.26 pefo 33:
1.102 fgsch 34: .if (${MACHINE_ARCH} == "powerpc") || (${MACHINE_ARCH} == "sparc64")
1.26 pefo 35: MFILES+= link.h dlfcn.h
36: .endif
1.1 deraadt 37:
38: DIRS= arpa protocols rpc rpcsvc
1.95 deraadt 39: LDIRS= crypto ddb dev isofs miscfs net netatalk netccitt netinet altq \
1.99 deraadt 40: netinet6 netipx netiso netnatm netns nfs scsi sys ufs uvm xfs
1.1 deraadt 41:
1.61 niklas 42: # Directories with an includes target
1.58 d 43: RDIRS= ../lib/libc_r ../lib/libcom_err ../lib/libcompat ../lib/libcurses \
1.104 ! deraadt 44: ../lib/libcurses++ ../lib/libform ../lib/libssl ../lib/libmenu \
! 45: ../lib/libocurses ../lib/libossaudio ../lib/libpanel ../lib/librpcsvc \
! 46: ../lib/libskey ../lib/libsectok ../lib/libedit ../lib/libpcap \
! 47: ../lib/libutil ../lib/libusbhid ../lib/libwrap ../lib/libz \
! 48: ../lib/libkeynote ../usr.bin/lex ../gnu/lib/libreadline \
! 49: ../sys/arch/${MACHINE}
1.7 deraadt 50:
1.62 niklas 51: # Places using Makefile that needs a prerequisite target met before includes
52: PRDIRS=
53:
1.61 niklas 54: # Directories with an includes target that use Makefile.bsd-wrapper
1.104 ! deraadt 55: WDIRS= ../usr.sbin/httpd ../gnu/egcs/libio ../gnu/egcs/libstdc++ \
! 56: ../gnu/egcs/libf2c ../gnu/egcs/libobjc ../gnu/egcs/gcc \
! 57: ../gnu/usr.bin/binutils
1.47 niklas 58:
1.61 niklas 59: # Places using Makefile.bsd-wrapper that needs a prerequisite target met
60: # before includes
1.104 ! deraadt 61: PWDIRS= ../usr.sbin/httpd ../gnu/egcs/libf2c ../gnu/usr.bin/binutils
1.61 niklas 62:
1.1 deraadt 63: NOOBJ= noobj
64:
65: # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
66: .include <bsd.own.mk>
67: SYS_INCLUDE?= copies
1.91 espie 68: .if ${KERBEROS:L} == "yes"
1.81 niklas 69: RDIRS+= ../kerberosIV/lib
70: PRDIRS+=../kerberosIV/lib/kadm ../kerberosIV/lib/krb
1.94 hin 71: .endif
72: .if ${KERBEROS5:L} == "yes"
73: RDIRS+= ../kerberosV/lib
1.9 tholo 74: .endif
1.61 niklas 75:
76: prereq:
1.91 espie 77: @for i in ${PRDIRS}; do \
1.62 niklas 78: echo preparing in ${.CURDIR}/$$i; \
1.91 espie 79: cd ${.CURDIR}/$$i && ${MAKE} prereq; \
1.62 niklas 80: done
1.91 espie 81: @for i in ${PWDIRS}; do \
1.61 niklas 82: echo preparing in ${.CURDIR}/$$i; \
1.91 espie 83: cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper prereq; \
1.61 niklas 84: done
1.1 deraadt 85:
1.6 deraadt 86: includes:
1.1 deraadt 87: @echo installing ${FILES}
1.91 espie 88: @for i in ${FILES}; do \
1.1 deraadt 89: cmp -s $$i ${DESTDIR}/usr/include/$$i || \
1.40 millert 90: ${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
1.1 deraadt 91: done
92: @echo installing ${DIRS}
1.91 espie 93: @for i in ${DIRS}; do \
1.32 downsj 94: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 95: ${DESTDIR}/usr/include/$$i; \
1.91 espie 96: cd ${.CURDIR}/$$i && for j in *.[ih]; do \
1.1 deraadt 97: cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
1.40 millert 98: ${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
1.91 espie 99: done; \
1.1 deraadt 100: done
1.73 beck 101: @rm -f ${DESTDIR}/usr/include/openssl
1.72 deraadt 102: @ln -sf ssl ${DESTDIR}/usr/include/openssl
1.1 deraadt 103: @echo installing ${LFILES}
1.91 espie 104: @for i in ${LFILES}; do \
105: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 106: ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
107: done
108: @echo installing ${MFILES}
1.91 espie 109: @for i in ${MFILES}; do \
110: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 111: ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
1.2 deraadt 112: done
1.1 deraadt 113: chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
114: find ${DESTDIR}/usr/include -type f | \
115: xargs chmod a=r
116: find ${DESTDIR}/usr/include -type d | \
117: xargs chmod u=rwx,go=rx
1.91 espie 118: @for i in ${RDIRS}; do \
1.7 deraadt 119: echo installing in ${.CURDIR}/$$i; \
1.91 espie 120: cd ${.CURDIR}/$$i && ${MAKE} includes; \
1.47 niklas 121: done
1.91 espie 122: @for i in ${WDIRS}; do \
1.47 niklas 123: echo installing in ${.CURDIR}/$$i; \
1.91 espie 124: cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper includes; \
1.7 deraadt 125: done
1.1 deraadt 126:
127: copies:
128: @echo copies: ${LDIRS}
1.91 espie 129: @for i in ${LDIRS}; do \
130: rm -rf ${DESTDIR}/usr/include/$$i && \
1.32 downsj 131: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 132: ${DESTDIR}/usr/include/$$i ; \
133: done
134: cd ../sys; \
135: pax -rw -pa -L \
1.101 mickey 136: `find ${LDIRS} -follow -type f -name '*.h' \
137: '!' -path 'dev/microcode/*' -print` ${DESTDIR}/usr/include
1.65 espie 138: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
1.32 downsj 139: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.65 espie 140: ${DESTDIR}/usr/include/${MACHINE}
1.52 espie 141: pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
1.1 deraadt 142: ../sys/arch/${MACHINE}/include/*.h \
1.65 espie 143: ${DESTDIR}/usr/include/${MACHINE}
1.1 deraadt 144: if test ${MACHINE} != ${MACHINE_ARCH} -a \
145: -d ../sys/arch/${MACHINE_ARCH}/include; then \
1.32 downsj 146: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 147: ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
1.52 espie 148: pax -rw -pa -s "|\.\./sys/arch/${MACHINE_ARCH}/include||" \
1.1 deraadt 149: ../sys/arch/${MACHINE_ARCH}/include/*.h \
150: ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
151: fi
1.65 espie 152: ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
1.1 deraadt 153:
154: symlinks:
155: @echo symlinks: ${LDIRS}
156: @for i in ${LDIRS}; do \
1.91 espie 157: rm -rf ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 158: ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
159: done
1.65 espie 160: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
161: ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
1.1 deraadt 162: if test ${MACHINE} != ${MACHINE_ARCH} -a \
163: -d ../sys/arch/${MACHINE_ARCH}/include ; then \
164: ln -s /sys/arch/${MACHINE_ARCH}/include \
165: ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
166: fi
1.91 espie 167: ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
1.1 deraadt 168:
1.6 deraadt 169: includes: ${SYS_INCLUDE}
170:
1.91 espie 171: .PHONY: prereq includes copies symlink
1.1 deraadt 172: .include <bsd.prog.mk>