1 # from: @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91 2 # $Id: Makefile,v 1.35 1994/03/31 04:06:01 cgd Exp $ 3 4 # Doing a make install builds /usr/include 5 # 6 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic 7 # links. 8 9 # Missing: mp.h 10 11 FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ 12 err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \ 13 math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h \ 14 regex.h regexp.h resolv.h \ 15 search.h setjmp.h sgtty.h stab.h stdarg.h stddef.h \ 16 stdio.h stdlib.h string.h strings.h struct.h sysexits.h time.h \ 17 ttyent.h tzfile.h unistd.h utime.h utmp.h varargs.h vis.h malloc.h \ 18 link.h 19 20 MFILES= float.h frame.h 21 LFILES= errno.h fcntl.h signal.h syslog.h termios.h 22 23 DIRS= arpa protocols rpc rpcsvc 24 LDIRS= dev net netinet netccitt netiso netns nfs sys ufs vm 25 26 NOOBJ= noobj 27 28 # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies 29 .include <bsd.own.mk> 30 SYS_INCLUDE?= copies 31 32 realinstall: 33 @echo installing ${FILES} 34 @-for i in ${FILES}; do \ 35 cmp -s $$i ${DESTDIR}/usr/include/$$i || \ 36 install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \ 37 done 38 @echo installing ${DIRS} 39 @-for i in ${DIRS}; do \ 40 install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i; \ 41 (cd $$i; for j in *.[ih]; do \ 42 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ 43 install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \ 44 done); \ 45 done 46 @echo installing ${LFILES} 47 @-for i in ${LFILES}; do \ 48 rm -f ${DESTDIR}/usr/include/$$i; \ 49 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 50 done 51 @echo installing ${MFILES} 52 @-for i in ${MFILES}; do \ 53 rm -f ${DESTDIR}/usr/include/$$i; \ 54 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 55 done 56 chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include 57 find ${DESTDIR}/usr/include -type f | \ 58 xargs chmod a-w 59 60 beforeinstall: 61 install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include 62 63 copies: 64 @echo copies: ${LDIRS} 65 @-for i in ${LDIRS}; do \ 66 rm -rf ${DESTDIR}/usr/include/$$i; \ 67 cd ../sys; \ 68 install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i ; \ 69 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ 70 done 71 rm -rf ${DESTDIR}/usr/include/machine 72 install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/machine 73 cd ../sys/arch/${MACHINE}/include; \ 74 tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); 75 rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 76 if test ${MACHINE} != ${MACHINE_ARCH} -a \ 77 -d ../sys/arch/${MACHINE_ARCH}/include ; then \ 78 install -d -o bin -g bin -m 755 \ 79 ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 80 cd ../sys/arch/${MACHINE_ARCH}/include ; \ 81 tar cf - *.h | \ 82 (cd ${DESTDIR}/usr/include/${MACHINE_ARCH} ; tar xpfB -); \ 83 else \ 84 ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 85 fi 86 87 symlinks: 88 @echo symlinks: ${LDIRS} 89 @for i in ${LDIRS}; do \ 90 rm -rf ${DESTDIR}/usr/include/$$i; \ 91 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 92 done 93 rm -rf ${DESTDIR}/usr/include/machine 94 ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine 95 rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH} 96 if test ${MACHINE} != ${MACHINE_ARCH} -a \ 97 -d ../sys/arch/${MACHINE_ARCH}/include ; then \ 98 ln -s /sys/arch/${MACHINE_ARCH}/include \ 99 ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 100 else \ 101 ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \ 102 fi 103 104 .include <bsd.prog.mk> 105 106 realinstall: ${SYS_INCLUDE} 107