Makefile revision 1.58
11.58Scgd#	$NetBSD: Makefile,v 1.58 1996/05/10 04:51:34 cgd Exp $
21.48Scgd
31.48Scgd#	@(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
41.21Smycroft
51.1Scgd# Doing a make install builds /usr/include
61.1Scgd#
71.1Scgd# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
81.1Scgd# links.
91.6Scgd
101.1Scgd# Missing: mp.h
111.1Scgd
121.56SjtcFILES=	a.out.h ar.h assert.h bitstring.h bm.h cpio.h ctype.h db.h dirent.h \
131.58Scgd	disktab.h err.h fnmatch.h fstab.h fts.h glob.h grp.h ieeefp.h \
141.58Scgd	iso646.h kvm.h langinfo.h limits.h locale.h malloc.h math.h \
151.56Sjtc	memory.h mpool.h ndbm.h netdb.h netgroup.h nlist.h nl_types.h paths.h \
161.56Sjtc	pwd.h ranlib.h re_comp.h regex.h regexp.h resolv.h search.h setjmp.h \
171.56Sjtc	sgtty.h signal.h stab.h stddef.h stdio.h stdlib.h string.h strings.h \
181.56Sjtc	struct.h sysexits.h tar.h time.h ttyent.h tzfile.h unistd.h utime.h \
191.56Sjtc	utmp.h vis.h
201.58Scgd
211.58Scgd.if (${MACHINE_ARCH} != "alpha")
221.58ScgdFILES+=	dlfcn.h link.h
231.58Scgd.endif
241.1Scgd
251.47ScgdMFILES=	float.h frame.h stdarg.h varargs.h
261.36ScgdLFILES=	errno.h fcntl.h syslog.h termios.h
271.1Scgd
281.26ScgdDIRS=	arpa protocols rpc rpcsvc
291.30ScgdLDIRS=	dev net netinet netccitt netiso netns nfs sys ufs vm 
301.1Scgd
311.1ScgdNOOBJ=	noobj
321.1Scgd
331.20Sbrezak# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
341.31Scgd.include <bsd.own.mk>
351.31ScgdSYS_INCLUDE?=	copies
361.1Scgd
371.57Sjtcincludes:
381.1Scgd	@echo installing ${FILES}
391.1Scgd	@-for i in ${FILES}; do \
401.1Scgd		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
411.34Scgd		    install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \
421.1Scgd	done
431.1Scgd	@echo installing ${DIRS}
441.1Scgd	@-for i in ${DIRS}; do \
451.51Sjtc		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
461.50Sjtc			${DESTDIR}/usr/include/$$i; \
471.1Scgd		(cd $$i; for j in *.[ih]; do \
481.1Scgd			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
491.34Scgd			install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
501.1Scgd		done); \
511.1Scgd	done
521.1Scgd	@echo installing ${LFILES}
531.1Scgd	@-for i in ${LFILES}; do \
541.1Scgd		rm -f ${DESTDIR}/usr/include/$$i; \
551.1Scgd		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
561.1Scgd	done
571.1Scgd	@echo installing ${MFILES}
581.1Scgd	@-for i in ${MFILES}; do \
591.1Scgd		rm -f ${DESTDIR}/usr/include/$$i; \
601.1Scgd		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
611.1Scgd	done
621.34Scgd	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
631.34Scgd	find ${DESTDIR}/usr/include -type f | \
641.45Scgd		xargs chmod a=r
651.45Scgd	find ${DESTDIR}/usr/include -type d | \
661.45Scgd		xargs chmod u=rwx,go=rx
671.1Scgd
681.1Scgdcopies:
691.1Scgd	@echo copies: ${LDIRS}
701.1Scgd	@-for i in ${LDIRS}; do \
711.40Scgd		rm -rf ${DESTDIR}/usr/include/$$i; \
721.50Sjtc		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
731.50Sjtc			${DESTDIR}/usr/include/$$i ; \
741.1Scgd	done
751.43Smycroft	cd ../sys; \
761.46Smycroft	pax -rw -pa -L \
771.54Smycroft	    `find ${LDIRS} -follow -type f -name '*.h' '!' -path \
781.54Smycroft	    'netiso/xebec/*' -print` ${DESTDIR}/usr/include
791.3Scgd	rm -rf ${DESTDIR}/usr/include/machine
801.50Sjtc	install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
811.50Sjtc		${DESTDIR}/usr/include/machine
821.44Sjtc	pax -rw -pa -s "|../sys/arch/${MACHINE}/include||" \
831.44Sjtc	    ../sys/arch/${MACHINE}/include/*.h \
841.44Sjtc	    ${DESTDIR}/usr/include/machine   
851.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
861.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
871.44Sjtc	    -d ../sys/arch/${MACHINE_ARCH}/include; then \
881.50Sjtc		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
891.44Sjtc    	    	    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
901.44Sjtc		pax -rw -pa -s "|../sys/arch/${MACHINE_ARCH}/include||" \
911.44Sjtc		    ../sys/arch/${MACHINE_ARCH}/include/*.h \
921.44Sjtc		    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
931.31Scgd	else \
941.44Sjtc		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
951.31Scgd	fi
961.1Scgd
971.1Scgdsymlinks:
981.1Scgd	@echo symlinks: ${LDIRS}
991.13Sproven	@for i in ${LDIRS}; do \
1001.13Sproven		rm -rf ${DESTDIR}/usr/include/$$i; \
1011.13Sproven		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
1021.13Sproven	done
1031.13Sproven	rm -rf ${DESTDIR}/usr/include/machine
1041.16Scgd	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
1051.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
1061.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
1071.35Scgd	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
1081.31Scgd		ln -s /sys/arch/${MACHINE_ARCH}/include \
1091.31Scgd		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1101.31Scgd	else \
1111.31Scgd		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
1121.31Scgd	fi
1131.14Sproven
1141.57Sjtcincludes: ${SYS_INCLUDE}
1151.57Sjtc
1161.14Sproven.include <bsd.prog.mk>
117