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