Makefile revision 1.35
11.21Smycroft#	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
21.35Scgd#	$Id: Makefile,v 1.35 1994/03/31 04:06:01 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.1ScgdFILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
121.19Smycroft	err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
131.19Smycroft	math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h \
141.32Scgd	regex.h regexp.h resolv.h \
151.32Scgd	search.h setjmp.h sgtty.h stab.h stdarg.h stddef.h \
161.28Sjtc	stdio.h stdlib.h string.h strings.h struct.h sysexits.h time.h \
171.28Sjtc	ttyent.h tzfile.h unistd.h utime.h utmp.h varargs.h vis.h malloc.h \
181.28Sjtc	link.h
191.1Scgd
201.1ScgdMFILES=	float.h frame.h
211.1ScgdLFILES=	errno.h fcntl.h signal.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.1Scgd
261.1ScgdNOOBJ=	noobj
271.1Scgd
281.20Sbrezak# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
291.31Scgd.include <bsd.own.mk>
301.31ScgdSYS_INCLUDE?=	copies
311.1Scgd
321.22Smycroftrealinstall:
331.1Scgd	@echo installing ${FILES}
341.1Scgd	@-for i in ${FILES}; do \
351.1Scgd		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
361.34Scgd		    install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \
371.1Scgd	done
381.1Scgd	@echo installing ${DIRS}
391.1Scgd	@-for i in ${DIRS}; do \
401.34Scgd		install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i; \
411.1Scgd		(cd $$i; for j in *.[ih]; do \
421.1Scgd			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
431.34Scgd			install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
441.1Scgd		done); \
451.1Scgd	done
461.1Scgd	@echo installing ${LFILES}
471.1Scgd	@-for i in ${LFILES}; do \
481.1Scgd		rm -f ${DESTDIR}/usr/include/$$i; \
491.1Scgd		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
501.1Scgd	done
511.1Scgd	@echo installing ${MFILES}
521.1Scgd	@-for i in ${MFILES}; do \
531.1Scgd		rm -f ${DESTDIR}/usr/include/$$i; \
541.1Scgd		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
551.1Scgd	done
561.34Scgd	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
571.34Scgd	find ${DESTDIR}/usr/include -type f | \
581.34Scgd		xargs chmod a-w
591.1Scgd
601.8Scgdbeforeinstall:
611.33Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include
621.8Scgd
631.1Scgdcopies:
641.1Scgd	@echo copies: ${LDIRS}
651.1Scgd	@-for i in ${LDIRS}; do \
661.1Scgd		rm -rf ${DESTDIR}/usr/include/$$i; \
671.11Scgd		cd ../sys; \
681.34Scgd		install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i ; \
691.1Scgd		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
701.1Scgd	done
711.3Scgd	rm -rf ${DESTDIR}/usr/include/machine
721.34Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/machine
731.16Scgd	cd ../sys/arch/${MACHINE}/include; \
741.31Scgd	    tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
751.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
761.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
771.35Scgd	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
781.34Scgd		install -d -o bin -g bin -m 755 \
791.34Scgd		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
801.31Scgd		cd ../sys/arch/${MACHINE_ARCH}/include ; \
811.31Scgd		tar cf - *.h | \
821.31Scgd		    (cd ${DESTDIR}/usr/include/${MACHINE_ARCH} ; tar xpfB -); \
831.31Scgd	else \
841.31Scgd		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
851.31Scgd	fi
861.1Scgd
871.1Scgdsymlinks:
881.1Scgd	@echo symlinks: ${LDIRS}
891.13Sproven	@for i in ${LDIRS}; do \
901.13Sproven		rm -rf ${DESTDIR}/usr/include/$$i; \
911.13Sproven		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
921.13Sproven	done
931.13Sproven	rm -rf ${DESTDIR}/usr/include/machine
941.16Scgd	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
951.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
961.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
971.35Scgd	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
981.31Scgd		ln -s /sys/arch/${MACHINE_ARCH}/include \
991.31Scgd		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1001.31Scgd	else \
1011.31Scgd		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1021.31Scgd	fi
1031.14Sproven
1041.14Sproven.include <bsd.prog.mk>
1051.23Smycroft
1061.23Smycroftrealinstall: ${SYS_INCLUDE}
107