Annotation of src/include/Makefile, Revision 1.193
1.193 ! deraadt 1: # $OpenBSD: Makefile,v 1.192 2014/07/12 16:25:08 guenther 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:
1.186 eric 12: FILES= a.out.h ar.h asr.h assert.h bitstring.h blf.h bsd_auth.h \
1.146 martynas 13: complex.h cpio.h ctype.h curses.h db.h dbm.h des.h dirent.h disktab.h \
1.164 deraadt 14: dlfcn.h elf_abi.h err.h errno.h fenv.h float.h fnmatch.h fstab.h fts.h \
15: ftw.h getopt.h glob.h grp.h ifaddrs.h inttypes.h iso646.h kvm.h \
1.183 naddy 16: langinfo.h libgen.h limits.h locale.h login_cap.h malloc.h math.h \
1.121 millert 17: md5.h memory.h mpool.h ndbm.h netdb.h netgroup.h nlist.h nl_types.h \
1.190 espie 18: paths.h poll.h pwd.h ranlib.h readpassphrase.h regex.h \
1.181 naddy 19: resolv.h rmd160.h search.h setjmp.h sha1.h sha2.h signal.h sndio.h \
1.179 deraadt 20: spawn.h stdbool.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \
21: sysexits.h tar.h tgmath.h time.h ttyent.h tzfile.h unistd.h utime.h \
22: utmp.h vis.h wchar.h wctype.h
1.8 deraadt 23:
1.177 deraadt 24: FILES+= link.h link_elf.h
1.86 hugh 25:
26: .if (${MACHINE_ARCH} != "vax")
27: FILES+= ieeefp.h
1.8 deraadt 28: .endif
1.1 deraadt 29:
1.164 deraadt 30: MFILES= frame.h
1.192 guenther 31: LFILES= endian.h fcntl.h syslog.h termios.h stdarg.h stdint.h varargs.h
1.1 deraadt 32:
33: DIRS= arpa protocols rpc rpcsvc
1.188 henning 34: LDIRS= crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \
1.191 tedu 35: netmpls net80211 nfs ntfs scsi sys ufs uvm
1.1 deraadt 36:
1.163 espie 37: # Places that need a prerequisite target met before includes
38: PRDIRS=
39:
1.61 niklas 40: # Directories with an includes target
1.193 ! deraadt 41: RDIRS= ../lib/libcrypto ../lib/libcurses ../lib/libedit \
! 42: ../lib/libevent ../lib/libexpat ../lib/libform \
! 43: ../lib/libfuse ../lib/libkeynote ../lib/libmenu \
! 44: ../lib/libocurses ../lib/libossaudio ../lib/libpanel \
! 45: ../lib/libpcap ../lib/libressl ../lib/librpcsvc \
! 46: ../lib/librthread ../lib/libskey ../lib/libsqlite3 \
! 47: ../lib/libssl ../lib/libusbhid ../lib/libutil ../lib/libz \
1.187 miod 48: ../usr.bin/lex ../gnu/lib/libreadline \
1.182 florian 49: ../gnu/usr.sbin/sendmail/libmilter \
1.179 deraadt 50: ../sys/arch/${MACHINE}
1.123 espie 51:
1.171 robert 52: .if ${COMPILER_VERSION:L} == "gcc3"
1.163 espie 53: RDIRS+= ../gnu/usr.bin/gcc ../gnu/lib/libobjc
54: PRDIRS+= ../gnu/lib/libstdc++
1.172 miod 55: .else
1.163 espie 56: RDIRS+= ../gnu/usr.bin/cc/libobjc
1.154 drahn 57: PRDIRS+= ../gnu/lib/libstdc++-v3
58: RDIRS+= ../gnu/usr.bin/cc/include
1.123 espie 59: .endif
1.61 niklas 60:
1.163 espie 61: # prereq implies includes
62: RDIRS += ${PRDIRS}
63:
1.1 deraadt 64: NOOBJ= noobj
65:
66: # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
67: SYS_INCLUDE?= copies
1.61 niklas 68:
1.163 espie 69: RUN_MAKE = if test -f Makefile.bsd-wrapper; then ${MAKE} -f Makefile.bsd-wrapper $@; else ${MAKE} $@; fi
70:
1.61 niklas 71: prereq:
1.91 espie 72: @for i in ${PRDIRS}; do \
1.62 niklas 73: echo preparing in ${.CURDIR}/$$i; \
1.163 espie 74: cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
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.118 markus 92: @rm -rf ${DESTDIR}/usr/include/openssl ${DESTDIR}/usr/include/ssl \
1.153 miod 93: ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_CPU}-openbsd/ssl \
94: ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_CPU}-openbsd/openssl
1.118 markus 95: @mkdir ${DESTDIR}/usr/include/openssl
96: @ln -sf openssl ${DESTDIR}/usr/include/ssl
1.1 deraadt 97: @echo installing ${LFILES}
1.91 espie 98: @for i in ${LFILES}; do \
99: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 100: ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
101: done
102: @echo installing ${MFILES}
1.91 espie 103: @for i in ${MFILES}; do \
104: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 105: ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
1.2 deraadt 106: done
1.1 deraadt 107: chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
1.136 deraadt 108: find ${DESTDIR}/usr/include -type f -print0 | \
109: xargs -0r chmod a=r
110: find ${DESTDIR}/usr/include -type d -print0 | \
111: xargs -0r chmod u=rwx,go=rx
1.91 espie 112: @for i in ${RDIRS}; do \
1.7 deraadt 113: echo installing in ${.CURDIR}/$$i; \
1.163 espie 114: cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
1.7 deraadt 115: done
1.1 deraadt 116:
117: copies:
118: @echo copies: ${LDIRS}
1.91 espie 119: @for i in ${LDIRS}; do \
120: rm -rf ${DESTDIR}/usr/include/$$i && \
1.32 downsj 121: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 122: ${DESTDIR}/usr/include/$$i ; \
123: done
124: cd ../sys; \
125: pax -rw -pa -L \
1.169 deraadt 126: `find ${LDIRS} -follow -type f -name '*.h' '!' \
1.174 kettenis 127: '(' -path 'dev/microcode/*' -or -path 'dev/pci/drm/*/*' ')' \
1.169 deraadt 128: -print` ${DESTDIR}/usr/include
1.153 miod 129: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} 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.153 miod 135: if test ${MACHINE} != ${MACHINE_CPU} -a \
136: -d ../sys/arch/${MACHINE_CPU}/include; then \
1.32 downsj 137: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.153 miod 138: ${DESTDIR}/usr/include/${MACHINE_CPU}; \
139: pax -rw -pa -s "|\.\./sys/arch/${MACHINE_CPU}/include||" \
140: ../sys/arch/${MACHINE_CPU}/include/*.h \
141: ${DESTDIR}/usr/include/${MACHINE_CPU}; \
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.153 miod 151: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
1.65 espie 152: ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
1.153 miod 153: if test ${MACHINE} != ${MACHINE_CPU} -a \
154: -d ../sys/arch/${MACHINE_CPU}/include ; then \
155: ln -s /sys/arch/${MACHINE_CPU}/include \
156: ${DESTDIR}/usr/include/${MACHINE_CPU} ; \
1.1 deraadt 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>