Makefile revision 9934
11833Swollman# From: @(#)Makefile 8.2 (Berkeley) 1/4/94 29934Swollman# $Id: Makefile,v 1.27 1995/07/13 10:04:11 rgrimes Exp $ 31539Srgrimes# 41539Srgrimes# Doing a make install builds /usr/include 51539Srgrimes# 61539Srgrimes# The ``rm -rf''s used below are safe because rm doesn't follow symbolic 71539Srgrimes# links. 81539Srgrimes# 94019Satsall depend lint tags: 101539Srgrimes 119512SrgrimesCLEANFILES=version vers.c 121833SwollmanSUBDIR= rpcsvc 131604Srgrimes# XXX MISSING: mp.h 141539SrgrimesFILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ 157387Sjkh err.h f2c.h fnmatch.h fstab.h fts.h glob.h grp.h strhash.h histedit.h \ 167387Sjkh kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h ndbm.h \ 177495Sjkh netdb.h nl_types.h nlist.h paths.h pwd.h ranlib.h regex.h regexp.h \ 183211Spst resolv.h rune.h runetype.h setjmp.h sgtty.h signal.h \ 192151Spaul stab.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \ 209934Swollman sysexits.h tar.h time.h ttyent.h unistd.h utime.h \ 211539Srgrimes utmp.h vis.h 227242Sphk.if defined(WANT_CSRG_LIBM) 232573SbdeFILES+= math.h 242573Sbde.endif 251539Srgrimes 263329SbdeMFILES= float.h floatingpoint.h stdarg.h varargs.h 271539SrgrimesLFILES= errno.h fcntl.h syslog.h termios.h 281539Srgrimes 291839SwollmanDIRS= arpa protocols rpc 301570SrgrimesLDIRS= net netccitt netinet netiso netns nfs sys vm 311570SrgrimesLUDIR= ufs 321570SrgrimesUDIRS= ufs/ffs ufs/lfs ufs/mfs ufs/ufs 331539Srgrimes 341539Srgrimes# Define SHARED to indicate whether you want symbolic links to the system 351539Srgrimes# source (``symlinks''), or a separate copy (``copies''); (latter useful 361539Srgrimes# in environments where it's not possible to keep /sys publicly readable) 371539Srgrimes# SHARED= copies 381570SrgrimesSHARED?= symlinks 391539Srgrimes 403214SpstOSREL = ${DESTDIR}/usr/include/osreldate.h 411917Swollmanbeforeinstall: ${SHARED} 422367Sbde @${ECHO} installing ${FILES} 439511Srgrimes @cd ${.CURDIR}; \ 449511Srgrimes for i in ${FILES}; do \ 454044Spst cmp -s $$i ${DESTDIR}/usr/include/$$i || \ 461539Srgrimes install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ 471539Srgrimes ${DESTDIR}/usr/include/$$i; \ 481539Srgrimes done 497152Sphk.if exists (${.CURDIR}/../sys/conf/newvers.sh) 507152Sphk @${ECHO} creating osreldate.h from newvers.sh 513214Spst @echo \#'undef __FreeBSD_version' > ${OSREL}.new 527152Sphk . ${.CURDIR}/../sys/conf/newvers.sh ; \ 537152Sphk echo \#'define __FreeBSD_version' $$RELDATE >> ${OSREL}.new 547152Sphk.else 557152Sphk @${ECHO} creating osreldate.h from sysctl info 567152Sphk @echo \#'undef __FreeBSD_version' > ${OSREL}.new 572004Swollman @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \ 583214Spst >> ${OSREL}.new 597152Sphk.endif 604044Spst @if cmp -s ${OSREL} ${OSREL}.new ; then \ 613214Spst rm -f ${OSREL}.new ; else \ 623214Spst mv -f ${OSREL}.new ${OSREL} ; fi 633214Spst @chown ${BINOWN}.${BINGRP} ${OSREL} 643214Spst @chmod 444 ${OSREL} 652367Sbde @${ECHO} installing ${DIRS} 661539Srgrimes @-for i in ${DIRS}; do \ 671539Srgrimes if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ 681539Srgrimes then \ 691539Srgrimes mkdir ${DESTDIR}/usr/include/$$i; \ 701539Srgrimes fi; \ 711539Srgrimes chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 721539Srgrimes chmod 755 ${DESTDIR}/usr/include/$$i; \ 739511Srgrimes (cd ${.CURDIR}/$$i; for j in *.[ih]; do \ 744044Spst cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ 751539Srgrimes install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ 761539Srgrimes ${DESTDIR}/usr/include/$$i/$$j; \ 771539Srgrimes done); \ 781539Srgrimes done 792367Sbde @${ECHO} installing ${LFILES} 801539Srgrimes @-for i in ${LFILES}; do \ 811539Srgrimes rm -f ${DESTDIR}/usr/include/$$i; \ 821539Srgrimes ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 831539Srgrimes chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 841539Srgrimes done 852367Sbde @${ECHO} installing ${MFILES} 861539Srgrimes @-for i in ${MFILES}; do \ 871539Srgrimes rm -f ${DESTDIR}/usr/include/$$i; \ 881539Srgrimes ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ 891539Srgrimes chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 901539Srgrimes done 911539Srgrimes 921539Srgrimescopies: 931570Srgrimes rm -rf ${DESTDIR}/usr/include/${LUDIR} 947131Srgrimes mkdir ${DESTDIR}/usr/include/${LUDIR} 957131Srgrimes chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/${LUDIR} 961570Srgrimes @-for i in ${LDIRS} ${UDIRS}; do \ 972367Sbde ${ECHO} ${SHARED} $$i; \ 981570Srgrimes rm -rf ${DESTDIR}/usr/include/$$i; \ 999511Srgrimes cd ${.CURDIR}/../sys; \ 1001570Srgrimes tar cf - $$i/*.h | \ 1011570Srgrimes (cd ${DESTDIR}/usr/include; tar xpfB -); \ 1021570Srgrimes chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;\ 1031570Srgrimes chmod -R 444 ${DESTDIR}/usr/include/$$i; \ 1041570Srgrimes chmod 755 ${DESTDIR}/usr/include/$$i; \ 1051539Srgrimes done 1061570Srgrimes rm -rf ${DESTDIR}/usr/include/machine 1071539Srgrimes mkdir ${DESTDIR}/usr/include/machine 1089511Srgrimes cd ${.CURDIR}/../sys/${MACHINE}/include && \ 1091570Srgrimes tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); 1101570Srgrimes chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine; 1111570Srgrimes chmod -R 444 ${DESTDIR}/usr/include/machine; 1121570Srgrimes chmod 755 ${DESTDIR}/usr/include/machine; 1131539Srgrimes 1141539Srgrimessymlinks: 1151570Srgrimes @for i in ${LDIRS} ${LUDIR}; do \ 1162367Sbde ${ECHO} ${SHARED} $$i; \ 1171570Srgrimes rm -rf ${DESTDIR}/usr/include/$$i; \ 1181570Srgrimes ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 1191570Srgrimes chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ 1201539Srgrimes done 1211570Srgrimes rm -rf ${DESTDIR}/usr/include/machine 1221570Srgrimes ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine 1231539Srgrimes 1241539Srgrimes.include <bsd.prog.mk> 125