| 1 | # @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91 |
| 2 | # |
| 3 | # Doing a make install builds /usr/include |
| 4 | # |
| 5 | # The ``rm -rf''s used below are safe because rm doesn't follow symbolic |
| 6 | # links. |
| 7 | # |
| 8 | all clean cleandir depend lint tags: |
| 9 | |
| 10 | # Missing: mp.h |
| 11 | |
| 12 | FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ |
| 13 | fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h math.h memory.h \ |
| 14 | ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h regexp.h \ |
| 15 | resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \ |
| 16 | stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \ |
| 17 | tzfile.h unistd.h utime.h utmp.h varargs.h vis.h |
| 18 | |
| 19 | MFILES= float.h frame.h |
| 20 | LFILES= errno.h fcntl.h signal.h syslog.h termios.h |
| 21 | |
| 22 | DIRS=arpa protocols |
| 23 | LDIRS= net netimp netinet netiso netns nfs sys ufs |
| 24 | |
| 25 | NOOBJ= noobj |
| 26 | |
| 27 | # Define SHARED to indicate whether you want symbolic links to the system |
| 28 | # source (``symlinks''), or a separate copy (``copies''); (latter useful |
| 29 | # in environments where it's not possible to keep /sys publicly readable) |
| 30 | # SHARED= copies |
| 31 | SHARED= symlinks |
| 32 | |
| 33 | install: ${SHARED} |
| 34 | @echo installing ${FILES} |
| 35 | @-for i in ${FILES}; do \ |
| 36 | cmp -s $$i ${DESTDIR}/usr/include/$$i || \ |
| 37 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ |
| 38 | ${DESTDIR}/usr/include/$$i; \ |
| 39 | done |
| 40 | @echo installing ${DIRS} |
| 41 | @-for i in ${DIRS}; do \ |
| 42 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ |
| 43 | then \ |
| 44 | mkdir ${DESTDIR}/usr/include/$$i; \ |
| 45 | fi; \ |
| 46 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
| 47 | chmod 755 ${DESTDIR}/usr/include/$$i; \ |
| 48 | (cd $$i; for j in *.[ih]; do \ |
| 49 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ |
| 50 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ |
| 51 | ${DESTDIR}/usr/include/$$i/$$j; \ |
| 52 | done); \ |
| 53 | done |
| 54 | @echo installing ${LFILES} |
| 55 | @-for i in ${LFILES}; do \ |
| 56 | rm -f ${DESTDIR}/usr/include/$$i; \ |
| 57 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ |
| 58 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
| 59 | done |
| 60 | @echo installing ${MFILES} |
| 61 | @-for i in ${MFILES}; do \ |
| 62 | rm -f ${DESTDIR}/usr/include/$$i; \ |
| 63 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ |
| 64 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
| 65 | done |
| 66 | |
| 67 | copies: |
| 68 | @echo copies: ${LDIRS} |
| 69 | @-for i in ${LDIRS}; do \ |
| 70 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
| 71 | cd /sys; \ |
| 72 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ |
| 73 | done |
| 74 | rm -f ${DESTDIR}/usr/include/machine |
| 75 | mkdir ${DESTDIR}/usr/include/machine |
| 76 | cd /sys/${MACHINE}/include; \ |
| 77 | tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \ |
| 78 | |
| 79 | symlinks: |
| 80 | @echo symlinks: ${LDIRS} |
| 81 | @for i in ${LDIRS}; do \ |
| 82 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
| 83 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ |
| 84 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
| 85 | done |
| 86 | rm -f ${DESTDIR}/usr/include/machine |
| 87 | ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine |
| 88 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine |
| 89 | |
| 90 | .include <bsd.prog.mk> |