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