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