Annotation of src/include/Makefile, Revision 1.220
1.220 ! naddy 1: # $OpenBSD: Makefile,v 1.219 2017/04/17 15:53:21 kettenis 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.212 tedu 13: complex.h cpio.h ctype.h curses.h db.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 \
1.210 deraadt 15: ftw.h getopt.h glob.h grp.h icdb.h ieeefp.h ifaddrs.h inttypes.h \
16: iso646.h kvm.h langinfo.h libgen.h limits.h link.h link_elf.h \
17: locale.h login_cap.h math.h md5.h memory.h ndbm.h netdb.h netgroup.h \
18: nlist.h nl_types.h paths.h poll.h pwd.h ranlib.h readpassphrase.h \
19: regex.h resolv.h rmd160.h search.h setjmp.h sha1.h sha2.h signal.h \
20: siphash.h sndio.h spawn.h stdbool.h stddef.h stdio.h stdlib.h \
1.218 guenther 21: string.h strings.h sysexits.h tar.h tgmath.h tib.h time.h \
1.210 deraadt 22: ttyent.h unistd.h utime.h utmp.h uuid.h vis.h wchar.h wctype.h
1.1 deraadt 23:
1.164 deraadt 24: MFILES= frame.h
1.192 guenther 25: LFILES= endian.h fcntl.h syslog.h termios.h stdarg.h stdint.h varargs.h
1.1 deraadt 26:
27: DIRS= arpa protocols rpc rpcsvc
1.188 henning 28: LDIRS= crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \
1.191 tedu 29: netmpls net80211 nfs ntfs scsi sys ufs uvm
1.1 deraadt 30:
1.163 espie 31: # Places that need a prerequisite target met before includes
1.214 tb 32: PRDIRS= ../lib/libcrypto ../lib/librpcsvc
1.163 espie 33:
1.61 niklas 34: # Directories with an includes target
1.214 tb 35: RDIRS= ../lib/libcurses ../lib/libedit \
1.193 deraadt 36: ../lib/libevent ../lib/libexpat ../lib/libform \
37: ../lib/libfuse ../lib/libkeynote ../lib/libmenu \
1.213 sthen 38: ../lib/libossaudio ../lib/libpanel ../lib/libpcap \
1.214 tb 39: ../lib/libradius ../lib/librthread \
1.213 sthen 40: ../lib/libskey ../lib/libssl ../lib/libtls \
1.196 jsing 41: ../lib/libusbhid ../lib/libutil ../lib/libz \
1.187 miod 42: ../usr.bin/lex ../gnu/lib/libreadline \
1.179 deraadt 43: ../sys/arch/${MACHINE}
1.123 espie 44:
1.219 kettenis 45: .if ${BUILD_GCC3:L} == "yes"
1.163 espie 46: RDIRS+= ../gnu/usr.bin/gcc ../gnu/lib/libobjc
47: PRDIRS+= ../gnu/lib/libstdc++
1.219 kettenis 48: .endif
49: .if ${BUILD_GCC4:L} == "yes"
1.163 espie 50: RDIRS+= ../gnu/usr.bin/cc/libobjc
1.214 tb 51: PRDIRS+= ../gnu/lib/libstdc++-v3 ../gnu/usr.bin/cc/include
1.219 kettenis 52: .endif
53: .if ${BUILD_CLANG:L} == "yes"
1.217 jsg 54: RDIRS+= ../lib/libcxxabi ../lib/libcxx
1.123 espie 55: .endif
1.61 niklas 56:
1.163 espie 57: # prereq implies includes
58: RDIRS += ${PRDIRS}
59:
1.1 deraadt 60: NOOBJ= noobj
61:
62: # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
63: SYS_INCLUDE?= copies
1.61 niklas 64:
1.163 espie 65: RUN_MAKE = if test -f Makefile.bsd-wrapper; then ${MAKE} -f Makefile.bsd-wrapper $@; else ${MAKE} $@; fi
66:
1.61 niklas 67: prereq:
1.91 espie 68: @for i in ${PRDIRS}; do \
1.62 niklas 69: echo preparing in ${.CURDIR}/$$i; \
1.163 espie 70: cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
1.61 niklas 71: done
1.1 deraadt 72:
1.6 deraadt 73: includes:
1.1 deraadt 74: @echo installing ${FILES}
1.91 espie 75: @for i in ${FILES}; do \
1.1 deraadt 76: cmp -s $$i ${DESTDIR}/usr/include/$$i || \
1.40 millert 77: ${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
1.1 deraadt 78: done
79: @echo installing ${DIRS}
1.91 espie 80: @for i in ${DIRS}; do \
1.32 downsj 81: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 82: ${DESTDIR}/usr/include/$$i; \
1.91 espie 83: cd ${.CURDIR}/$$i && for j in *.[ih]; do \
1.1 deraadt 84: cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
1.40 millert 85: ${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
1.91 espie 86: done; \
1.1 deraadt 87: done
88: @echo installing ${LFILES}
1.91 espie 89: @for i in ${LFILES}; do \
90: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 91: ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
92: done
93: @echo installing ${MFILES}
1.91 espie 94: @for i in ${MFILES}; do \
95: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 96: ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
1.2 deraadt 97: done
1.91 espie 98: @for i in ${RDIRS}; do \
1.7 deraadt 99: echo installing in ${.CURDIR}/$$i; \
1.163 espie 100: cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
1.7 deraadt 101: done
1.215 tb 102: chown -RP ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
1.220 ! naddy 103: find ${DESTDIR}/usr/include \
! 104: -type f -exec chmod a=r {} + -o \
! 105: \( -type d -o -type l \) -exec chmod -h u=rwx,go=rx {} +
1.1 deraadt 106:
107: copies:
108: @echo copies: ${LDIRS}
1.91 espie 109: @for i in ${LDIRS}; do \
110: rm -rf ${DESTDIR}/usr/include/$$i && \
1.32 downsj 111: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 112: ${DESTDIR}/usr/include/$$i ; \
113: done
114: cd ../sys; \
115: pax -rw -pa -L \
1.169 deraadt 116: `find ${LDIRS} -follow -type f -name '*.h' '!' \
1.206 kettenis 117: '(' -path 'dev/microcode/*' -or -path 'dev/pci/drm/*' ')' \
1.169 deraadt 118: -print` ${DESTDIR}/usr/include
1.153 miod 119: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
1.32 downsj 120: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.65 espie 121: ${DESTDIR}/usr/include/${MACHINE}
1.111 itojun 122: pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
123: ../sys/arch/${MACHINE}/include/*.h \
124: ${DESTDIR}/usr/include/${MACHINE}
1.153 miod 125: if test ${MACHINE} != ${MACHINE_CPU} -a \
126: -d ../sys/arch/${MACHINE_CPU}/include; then \
1.32 downsj 127: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.153 miod 128: ${DESTDIR}/usr/include/${MACHINE_CPU}; \
129: pax -rw -pa -s "|\.\./sys/arch/${MACHINE_CPU}/include||" \
130: ../sys/arch/${MACHINE_CPU}/include/*.h \
131: ${DESTDIR}/usr/include/${MACHINE_CPU}; \
1.1 deraadt 132: fi
1.65 espie 133: ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
1.1 deraadt 134:
135: symlinks:
136: @echo symlinks: ${LDIRS}
137: @for i in ${LDIRS}; do \
1.91 espie 138: rm -rf ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 139: ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
140: done
1.153 miod 141: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
1.65 espie 142: ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
1.153 miod 143: if test ${MACHINE} != ${MACHINE_CPU} -a \
144: -d ../sys/arch/${MACHINE_CPU}/include ; then \
145: ln -s /sys/arch/${MACHINE_CPU}/include \
146: ${DESTDIR}/usr/include/${MACHINE_CPU} ; \
1.1 deraadt 147: fi
1.91 espie 148: ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
1.1 deraadt 149:
1.6 deraadt 150: includes: ${SYS_INCLUDE}
151:
1.91 espie 152: .PHONY: prereq includes copies symlink
1.1 deraadt 153: .include <bsd.prog.mk>