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