Makefile revision 1.45
11.21Smycroft#	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
21.45Scgd#	$Id: Makefile,v 1.45 1994/07/21 07:33:11 cgd Exp $
31.21Smycroft
41.1Scgd# Doing a make install builds /usr/include
51.1Scgd#
61.1Scgd# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
71.1Scgd# links.
81.6Scgd
91.1Scgd# Missing: mp.h
101.1Scgd
111.42ScgdFILES=	a.out.h ar.h assert.h bitstring.h bm.h ctype.h db.h dirent.h disktab.h \
121.41Sjtc	err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h langinfo.h limits.h \
131.41Sjtc	locale.h math.h memory.h mpool.h ndbm.h netdb.h nlist.h nl_types.h \
141.41Sjtc	paths.h pwd.h ranlib.h regex.h regexp.h resolv.h \
151.36Scgd	search.h setjmp.h sgtty.h signal.h stab.h stdarg.h stddef.h \
161.28Sjtc	stdio.h stdlib.h string.h strings.h struct.h sysexits.h time.h \
171.38Scgd	ttyent.h tzfile.h unistd.h utime.h utmp.h vis.h malloc.h \
181.28Sjtc	link.h
191.1Scgd
201.37ScgdMFILES=	float.h frame.h varargs.h
211.36ScgdLFILES=	errno.h fcntl.h syslog.h termios.h
221.1Scgd
231.26ScgdDIRS=	arpa protocols rpc rpcsvc
241.30ScgdLDIRS=	dev net netinet netccitt netiso netns nfs sys ufs vm 
251.40Scgd# the following only used when making copies
261.40ScgdLSUBDIRS= ufs/ffs ufs/lfs ufs/mfs ufs/ufs
271.1Scgd
281.1ScgdNOOBJ=	noobj
291.1Scgd
301.20Sbrezak# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
311.31Scgd.include <bsd.own.mk>
321.31ScgdSYS_INCLUDE?=	copies
331.1Scgd
341.22Smycroftrealinstall:
351.1Scgd	@echo installing ${FILES}
361.1Scgd	@-for i in ${FILES}; do \
371.1Scgd		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
381.34Scgd		    install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \
391.1Scgd	done
401.1Scgd	@echo installing ${DIRS}
411.1Scgd	@-for i in ${DIRS}; do \
421.34Scgd		install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i; \
431.1Scgd		(cd $$i; for j in *.[ih]; do \
441.1Scgd			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
451.34Scgd			install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
461.1Scgd		done); \
471.1Scgd	done
481.1Scgd	@echo installing ${LFILES}
491.1Scgd	@-for i in ${LFILES}; do \
501.1Scgd		rm -f ${DESTDIR}/usr/include/$$i; \
511.1Scgd		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
521.1Scgd	done
531.1Scgd	@echo installing ${MFILES}
541.1Scgd	@-for i in ${MFILES}; do \
551.1Scgd		rm -f ${DESTDIR}/usr/include/$$i; \
561.1Scgd		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
571.1Scgd	done
581.34Scgd	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
591.34Scgd	find ${DESTDIR}/usr/include -type f | \
601.45Scgd		xargs chmod a=r
611.45Scgd	find ${DESTDIR}/usr/include -type d | \
621.45Scgd		xargs chmod u=rwx,go=rx
631.1Scgd
641.8Scgdbeforeinstall:
651.33Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include
661.8Scgd
671.1Scgdcopies:
681.1Scgd	@echo copies: ${LDIRS}
691.1Scgd	@-for i in ${LDIRS}; do \
701.40Scgd		rm -rf ${DESTDIR}/usr/include/$$i; \
711.40Scgd		install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i ; \
721.1Scgd	done
731.43Smycroft# This would be simpler if we didn't care whether netiso/xebec gets installed.
741.43Smycroft	cd ../sys; \
751.43Smycroft	pax -rw -pa -L `find ${LDIRS} '(' -type d -path '*/*' -prune ')' -o \
761.43Smycroft	    '(' -type f -name '*.h' -print ')'; \
771.43Smycroft	    find ${LSUBDIRS} -type f -name '*.h' -print` ${DESTDIR}/usr/include
781.3Scgd	rm -rf ${DESTDIR}/usr/include/machine
791.34Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/machine
801.44Sjtc	pax -rw -pa -s "|../sys/arch/${MACHINE}/include||" \
811.44Sjtc	    ../sys/arch/${MACHINE}/include/*.h \
821.44Sjtc	    ${DESTDIR}/usr/include/machine   
831.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
841.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
851.44Sjtc	    -d ../sys/arch/${MACHINE_ARCH}/include; then \
861.34Scgd		install -d -o bin -g bin -m 755 \
871.44Sjtc    	    	    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
881.44Sjtc		pax -rw -pa -s "|../sys/arch/${MACHINE_ARCH}/include||" \
891.44Sjtc		    ../sys/arch/${MACHINE_ARCH}/include/*.h \
901.44Sjtc		    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
911.31Scgd	else \
921.44Sjtc		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
931.31Scgd	fi
941.1Scgd
951.1Scgdsymlinks:
961.1Scgd	@echo symlinks: ${LDIRS}
971.13Sproven	@for i in ${LDIRS}; do \
981.13Sproven		rm -rf ${DESTDIR}/usr/include/$$i; \
991.13Sproven		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
1001.13Sproven	done
1011.13Sproven	rm -rf ${DESTDIR}/usr/include/machine
1021.16Scgd	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
1031.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
1041.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
1051.35Scgd	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
1061.31Scgd		ln -s /sys/arch/${MACHINE_ARCH}/include \
1071.31Scgd		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1081.31Scgd	else \
1091.31Scgd		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1101.31Scgd	fi
1111.14Sproven
1121.14Sproven.include <bsd.prog.mk>
1131.23Smycroft
1141.23Smycroftrealinstall: ${SYS_INCLUDE}
115