1 # from: @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91 2 # $Id: Makefile,v 1.21 1993/08/01 05:41:49 mycroft 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 SUBDIR= rpcsvc 10 11 # Missing: mp.h 12 13 FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ 14 err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \ 15 math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h \ 16 regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \ 17 stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \ 18 tzfile.h unistd.h utime.h utmp.h varargs.h vis.h malloc.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 24 LDIRS= 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 .if !defined(SYS_INCLUDE) 30 SYS_INCLUDE= copies 31 .endif 32 33 install: beforeinstall _PROGSUBDIR ${SYS_INCLUDE} 34 @echo installing ${FILES} 35 @-for i in ${FILES}; do \ 36 cmp -s $$i ${DESTDIR}/usr/include/$$i || \ 37 install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \ 38 done 39 @echo installing ${DIRS} 40 @-for i in ${DIRS}; do \ 41 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ 42 then \ 43 mkdir ${DESTDIR}/usr/include/$$i; \ 44 fi; \ 45 (cd $$i; for j in *.[ih]; do \ 46 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ 47 install -c -m 644 $$j ${DESTDIR}/usr/include/$$i/$$j; \ 48 done); \ 49 done 50 @echo installing ${LFILES} 51 @-for i in ${LFILES}; do \ 52 rm -f ${DESTDIR}/usr/include/$$i; \ 53 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 54 done 55 @echo installing ${MFILES} 56 @-for i in ${MFILES}; do \ 57 rm -f ${DESTDIR}/usr/include/$$i; \ 58 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 59 done 60 @chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include 61 @chmod -R a-w ${DESTDIR}/usr/include 62 63 beforeinstall: 64 @if [ ! -d ${DESTDIR}/usr/include ]; then \ 65 /bin/rm -f ${DESTDIR}/usr/include ; \ 66 mkdir -p ${DESTDIR}/usr/include ; \ 67 else \ 68 true ; \ 69 fi 70 71 copies: 72 @echo copies: ${LDIRS} 73 @-for i in ${LDIRS}; do \ 74 rm -rf ${DESTDIR}/usr/include/$$i; \ 75 cd ../sys; \ 76 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ 77 done 78 rm -rf ${DESTDIR}/usr/include/machine 79 mkdir ${DESTDIR}/usr/include/machine 80 cd ../sys/arch/${MACHINE}/include; \ 81 tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \ 82 83 symlinks: 84 @echo symlinks: ${LDIRS} 85 @for i in ${LDIRS}; do \ 86 rm -rf ${DESTDIR}/usr/include/$$i; \ 87 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 88 done 89 rm -rf ${DESTDIR}/usr/include/machine 90 ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine 91 92 .include <bsd.prog.mk> 93