1# @(#)Makefile 5.30 (Berkeley) 05/11/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 cencode.h ctype.h curses.h ndbm.h \ 12 dirent.h disktab.h fcntl.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 stdio.h string.h \ 15 strings.h struct.h sysexits.h time.h ttyent.h tzfile.h unistd.h \ 16 utmp.h varargs.h vfont.h 17LMCH= float.h frame.h 18LSYS= errno.h signal.h syslog.h termios.h 19 20DIRS= sys net netimp netinet netiso netns ufs nfs 21.if (${MACHINE} == "tahoe") 22DIRS+= tahoe tahoemath tahoevba tahoeif 23.elif (${MACHINE} == "vax") 24DIRS+= vax vaxmba vaxuba vaxif 25.endif 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 31SHARED= symlinks 32 33install: ${SHARED} 34 @echo installing ${STD} 35 @-for i in ${STD}; do \ 36 cmp -s $$i ${DESTDIR}/usr/Xinclude/$$i || \ 37 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ 38 ${DESTDIR}/usr/include/$$i; \ 39 done 40 @echo installing ${SUBDIRS} 41 @-for i in ${SUBDIRS}; 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/Xinclude/$$i/$$j || \ 50 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ 51 ${DESTDIR}/usr/include/$$i/$$j; \ 52 done); \ 53 done 54 install -c -o ${BINOWN} -g ${BINGRP} -m 444 Makefile.install \ 55 ${DESTDIR}/usr/include/Makefile 56 rm -f ${DESTDIR}/usr/include/machine 57 ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine 58 @echo installing ${LSYS} 59 @-for i in ${LSYS}; do \ 60 rm -f ${DESTDIR}/usr/include/$$i; \ 61 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 62 done 63 @echo installing ${LMCH} 64 @-for i in ${LMCH}; do \ 65 rm -f ${DESTDIR}/usr/include/$$i; \ 66 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 67 done 68 69symlinks: 70 @echo installing ${DIRS} 71 @-for i in ${DIRS}; do \ 72 rm -rf ${DESTDIR}/usr/include/$$i; \ 73 if [ ! -s ${DESTDIR}/usr/include/$$i ]; \ 74 then \ 75 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 76 else \ 77 echo ${DESTDIR}/usr/include/$$i not removed; \ 78 fi; \ 79 done 80 81copies: 82 @echo installing ${DIRS} 83 @-for i in ${DIRS}; do \ 84 rm -rf ${DESTDIR}/usr/include/$$i; \ 85 cd /sys; \ 86 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ 87 done 88 89.include <bsd.own.mk> 90