1# From: @(#)Makefile 8.2 (Berkeley) 1/4/94 2# $Id: Makefile,v 1.29 1995/08/06 12:23:05 bde 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# 9all depend lint tags: 10 11CLEANFILES=version vers.c 12SUBDIR= rpcsvc 13# XXX MISSING: mp.h 14FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ 15 err.h f2c.h fnmatch.h fstab.h fts.h glob.h grp.h strhash.h histedit.h \ 16 kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h ndbm.h \ 17 netdb.h nl_types.h nlist.h paths.h pwd.h ranlib.h regex.h regexp.h \ 18 resolv.h rune.h runetype.h setjmp.h sgtty.h signal.h \ 19 stab.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \ 20 sysexits.h tar.h time.h ttyent.h unistd.h utime.h \ 21 utmp.h vis.h 22.if defined(WANT_CSRG_LIBM) 23FILES+= math.h 24.endif 25 26MFILES= float.h floatingpoint.h stdarg.h varargs.h 27LFILES= errno.h fcntl.h syslog.h termios.h 28 29DIRS= arpa protocols rpc 30LDIRS= net netccitt netinet netipx netiso netns nfs sys vm 31LUDIR= ufs 32UDIRS= ufs/ffs ufs/lfs ufs/mfs ufs/ufs 33 34# Define SHARED to indicate whether you want symbolic links to the system 35# source (``symlinks''), or a separate copy (``copies''); (latter useful 36# in environments where it's not possible to keep /sys publicly readable) 37# SHARED= copies 38SHARED?= symlinks 39 40OSREL = ${DESTDIR}/usr/include/osreldate.h 41beforeinstall: ${SHARED} 42 @${ECHO} installing ${FILES} 43 @cd ${.CURDIR}; \ 44 for i in ${FILES}; do \ 45 cmp -s $$i ${DESTDIR}/usr/include/$$i || \ 46 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ 47 ${DESTDIR}/usr/include/$$i; \ 48 done 49.if exists (${.CURDIR}/../sys/conf/newvers.sh) 50 @${ECHO} creating osreldate.h from newvers.sh 51 @echo \#'undef __FreeBSD_version' > ${OSREL}.new 52 . ${.CURDIR}/../sys/conf/newvers.sh ; \ 53 echo \#'define __FreeBSD_version' $$RELDATE >> ${OSREL}.new 54.else 55 @${ECHO} creating osreldate.h from sysctl info 56 @echo \#'undef __FreeBSD_version' > ${OSREL}.new 57 @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \ 58 >> ${OSREL}.new 59.endif 60 @if cmp -s ${OSREL} ${OSREL}.new ; then \ 61 rm -f ${OSREL}.new ; else \ 62 mv -f ${OSREL}.new ${OSREL} ; fi 63 @chown ${BINOWN}.${BINGRP} ${OSREL} 64 @chmod 444 ${OSREL} 65 @${ECHO} installing ${DIRS} 66 @-for i in ${DIRS}; do \ 67 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ 68 then \ 69 mkdir ${DESTDIR}/usr/include/$$i; \ 70 fi; \ 71 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 72 chmod 755 ${DESTDIR}/usr/include/$$i; \ 73 (cd ${.CURDIR}/$$i; for j in *.[ih]; do \ 74 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ 75 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ 76 ${DESTDIR}/usr/include/$$i/$$j; \ 77 done); \ 78 done 79 @${ECHO} installing ${LFILES} 80 @-for i in ${LFILES}; do \ 81 rm -f ${DESTDIR}/usr/include/$$i; \ 82 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 83 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 84 done 85 @${ECHO} installing ${MFILES} 86 @-for i in ${MFILES}; do \ 87 rm -f ${DESTDIR}/usr/include/$$i; \ 88 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 89 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 90 done 91 92copies: 93 rm -rf ${DESTDIR}/usr/include/${LUDIR} 94 mkdir ${DESTDIR}/usr/include/${LUDIR} 95 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/${LUDIR} 96 @-for i in ${LDIRS} ${UDIRS}; do \ 97 ${ECHO} ${SHARED} $$i; \ 98 rm -rf ${DESTDIR}/usr/include/$$i; \ 99 cd ${.CURDIR}/../sys; \ 100 tar cf - $$i/*.h | \ 101 (cd ${DESTDIR}/usr/include; tar xpfB -); \ 102 chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;\ 103 chmod -R 444 ${DESTDIR}/usr/include/$$i; \ 104 chmod 755 ${DESTDIR}/usr/include/$$i; \ 105 done 106 rm -rf ${DESTDIR}/usr/include/machine 107 mkdir ${DESTDIR}/usr/include/machine 108 cd ${.CURDIR}/../sys/${MACHINE}/include && \ 109 tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); 110 chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine; 111 chmod -R 444 ${DESTDIR}/usr/include/machine; 112 chmod 755 ${DESTDIR}/usr/include/machine; 113 114symlinks: 115 @for i in ${LDIRS} ${LUDIR}; do \ 116 ${ECHO} ${SHARED} $$i; \ 117 rm -rf ${DESTDIR}/usr/include/$$i; \ 118 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 119 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 120 done 121 rm -rf ${DESTDIR}/usr/include/machine 122 ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine 123 124.include <bsd.prog.mk> 125