Makefile revision 1.47
11.21Smycroft#	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
21.47Scgd#	$Id: Makefile,v 1.47 1994/10/15 04:57:10 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.47Scgd	search.h setjmp.h sgtty.h signal.h stab.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.47ScgdMFILES=	float.h frame.h stdarg.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.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.45Scgd		xargs chmod a=r
591.45Scgd	find ${DESTDIR}/usr/include -type d | \
601.45Scgd		xargs chmod u=rwx,go=rx
611.1Scgd
621.8Scgdbeforeinstall:
631.33Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include
641.8Scgd
651.1Scgdcopies:
661.1Scgd	@echo copies: ${LDIRS}
671.1Scgd	@-for i in ${LDIRS}; do \
681.40Scgd		rm -rf ${DESTDIR}/usr/include/$$i; \
691.40Scgd		install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/$$i ; \
701.1Scgd	done
711.43Smycroft	cd ../sys; \
721.46Smycroft	pax -rw -pa -L \
731.46Smycroft	    `find ${LDIRS} -type f -name '*.h' '!' -path 'netiso/xebec/*' \
741.46Smycroft	    -print` ${DESTDIR}/usr/include
751.3Scgd	rm -rf ${DESTDIR}/usr/include/machine
761.34Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/machine
771.44Sjtc	pax -rw -pa -s "|../sys/arch/${MACHINE}/include||" \
781.44Sjtc	    ../sys/arch/${MACHINE}/include/*.h \
791.44Sjtc	    ${DESTDIR}/usr/include/machine   
801.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
811.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
821.44Sjtc	    -d ../sys/arch/${MACHINE_ARCH}/include; then \
831.34Scgd		install -d -o bin -g bin -m 755 \
841.44Sjtc    	    	    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
851.44Sjtc		pax -rw -pa -s "|../sys/arch/${MACHINE_ARCH}/include||" \
861.44Sjtc		    ../sys/arch/${MACHINE_ARCH}/include/*.h \
871.44Sjtc		    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
881.31Scgd	else \
891.44Sjtc		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
901.31Scgd	fi
911.1Scgd
921.1Scgdsymlinks:
931.1Scgd	@echo symlinks: ${LDIRS}
941.13Sproven	@for i in ${LDIRS}; do \
951.13Sproven		rm -rf ${DESTDIR}/usr/include/$$i; \
961.13Sproven		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
971.13Sproven	done
981.13Sproven	rm -rf ${DESTDIR}/usr/include/machine
991.16Scgd	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
1001.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
1011.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
1021.35Scgd	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
1031.31Scgd		ln -s /sys/arch/${MACHINE_ARCH}/include \
1041.31Scgd		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1051.31Scgd	else \
1061.31Scgd		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1071.31Scgd	fi
1081.14Sproven
1091.14Sproven.include <bsd.prog.mk>
1101.23Smycroft
1111.23Smycroftrealinstall: ${SYS_INCLUDE}
112