Annotation of src/include/Makefile, Revision 1.205
1.204 guenther 1: # $OpenBSD: Makefile,v 1.203 2015/09/09 15:35:24 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.198 tedu 13: complex.h cpio.h ctype.h curses.h db.h dbm.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.203 guenther 17: md5.h memory.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.197 tedu 19: resolv.h rmd160.h search.h setjmp.h sha1.h sha2.h signal.h siphash.h \
20: sndio.h \
1.179 deraadt 21: spawn.h stdbool.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \
1.201 millert 22: sysexits.h tar.h tgmath.h time.h ttyent.h unistd.h utime.h \
1.194 miod 23: utmp.h uuid.h vis.h wchar.h wctype.h
1.8 deraadt 24:
1.177 deraadt 25: FILES+= link.h link_elf.h
1.86 hugh 26:
27: .if (${MACHINE_ARCH} != "vax")
28: FILES+= ieeefp.h
1.8 deraadt 29: .endif
1.1 deraadt 30:
1.164 deraadt 31: MFILES= frame.h
1.192 guenther 32: LFILES= endian.h fcntl.h syslog.h termios.h stdarg.h stdint.h varargs.h
1.1 deraadt 33:
34: DIRS= arpa protocols rpc rpcsvc
1.188 henning 35: LDIRS= crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \
1.191 tedu 36: netmpls net80211 nfs ntfs scsi sys ufs uvm
1.1 deraadt 37:
1.163 espie 38: # Places that need a prerequisite target met before includes
39: PRDIRS=
40:
1.61 niklas 41: # Directories with an includes target
1.193 deraadt 42: RDIRS= ../lib/libcrypto ../lib/libcurses ../lib/libedit \
43: ../lib/libevent ../lib/libexpat ../lib/libform \
44: ../lib/libfuse ../lib/libkeynote ../lib/libmenu \
45: ../lib/libocurses ../lib/libossaudio ../lib/libpanel \
1.202 yasuoka 46: ../lib/libpcap ../lib/libradius ../lib/librpcsvc ../lib/librthread \
47: ../lib/libskey ../lib/libsqlite3 ../lib/libssl ../lib/libtls \
1.196 jsing 48: ../lib/libusbhid ../lib/libutil ../lib/libz \
1.187 miod 49: ../usr.bin/lex ../gnu/lib/libreadline \
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.200 sthen 92: @ln -sfh openssl ${DESTDIR}/usr/include/ssl
1.1 deraadt 93: @echo installing ${LFILES}
1.91 espie 94: @for i in ${LFILES}; do \
95: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 96: ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
97: done
98: @echo installing ${MFILES}
1.91 espie 99: @for i in ${MFILES}; do \
100: rm -f ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 101: ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
1.2 deraadt 102: done
1.1 deraadt 103: chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
1.136 deraadt 104: find ${DESTDIR}/usr/include -type f -print0 | \
105: xargs -0r chmod a=r
106: find ${DESTDIR}/usr/include -type d -print0 | \
107: xargs -0r chmod u=rwx,go=rx
1.91 espie 108: @for i in ${RDIRS}; do \
1.7 deraadt 109: echo installing in ${.CURDIR}/$$i; \
1.163 espie 110: cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
1.7 deraadt 111: done
1.1 deraadt 112:
113: copies:
114: @echo copies: ${LDIRS}
1.91 espie 115: @for i in ${LDIRS}; do \
116: rm -rf ${DESTDIR}/usr/include/$$i && \
1.32 downsj 117: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.1 deraadt 118: ${DESTDIR}/usr/include/$$i ; \
119: done
120: cd ../sys; \
121: pax -rw -pa -L \
1.169 deraadt 122: `find ${LDIRS} -follow -type f -name '*.h' '!' \
1.174 kettenis 123: '(' -path 'dev/microcode/*' -or -path 'dev/pci/drm/*/*' ')' \
1.169 deraadt 124: -print` ${DESTDIR}/usr/include
1.153 miod 125: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
1.32 downsj 126: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.65 espie 127: ${DESTDIR}/usr/include/${MACHINE}
1.111 itojun 128: pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
129: ../sys/arch/${MACHINE}/include/*.h \
130: ${DESTDIR}/usr/include/${MACHINE}
1.153 miod 131: if test ${MACHINE} != ${MACHINE_CPU} -a \
132: -d ../sys/arch/${MACHINE_CPU}/include; then \
1.32 downsj 133: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
1.153 miod 134: ${DESTDIR}/usr/include/${MACHINE_CPU}; \
135: pax -rw -pa -s "|\.\./sys/arch/${MACHINE_CPU}/include||" \
136: ../sys/arch/${MACHINE_CPU}/include/*.h \
137: ${DESTDIR}/usr/include/${MACHINE_CPU}; \
1.1 deraadt 138: fi
1.65 espie 139: ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
1.1 deraadt 140:
141: symlinks:
142: @echo symlinks: ${LDIRS}
143: @for i in ${LDIRS}; do \
1.91 espie 144: rm -rf ${DESTDIR}/usr/include/$$i && \
1.1 deraadt 145: ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
146: done
1.153 miod 147: cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
1.65 espie 148: ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
1.153 miod 149: if test ${MACHINE} != ${MACHINE_CPU} -a \
150: -d ../sys/arch/${MACHINE_CPU}/include ; then \
151: ln -s /sys/arch/${MACHINE_CPU}/include \
152: ${DESTDIR}/usr/include/${MACHINE_CPU} ; \
1.1 deraadt 153: fi
1.91 espie 154: ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
1.1 deraadt 155:
1.6 deraadt 156: includes: ${SYS_INCLUDE}
157:
1.91 espie 158: .PHONY: prereq includes copies symlink
1.1 deraadt 159: .include <bsd.prog.mk>