Makefile revision 1.43
11.21Smycroft#	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
21.43Smycroft#	$Id: Makefile,v 1.43 1994/06/22 15:09:35 mycroft 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.34Scgd		xargs chmod a-w
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# This would be simpler if we didn't care whether netiso/xebec gets installed.
721.43Smycroft	cd ../sys; \
731.43Smycroft	pax -rw -pa -L `find ${LDIRS} '(' -type d -path '*/*' -prune ')' -o \
741.43Smycroft	    '(' -type f -name '*.h' -print ')'; \
751.43Smycroft	    find ${LSUBDIRS} -type f -name '*.h' -print` ${DESTDIR}/usr/include
761.3Scgd	rm -rf ${DESTDIR}/usr/include/machine
771.34Scgd	install -d -o bin -g bin -m 755 ${DESTDIR}/usr/include/machine
781.16Scgd	cd ../sys/arch/${MACHINE}/include; \
791.31Scgd	    tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
801.31Scgd	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
811.35Scgd	if test ${MACHINE} != ${MACHINE_ARCH} -a \
821.35Scgd	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
831.34Scgd		install -d -o bin -g bin -m 755 \
841.34Scgd		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
851.31Scgd		cd ../sys/arch/${MACHINE_ARCH}/include ; \
861.31Scgd		tar cf - *.h | \
871.31Scgd		    (cd ${DESTDIR}/usr/include/${MACHINE_ARCH} ; tar xpfB -); \
881.31Scgd	else \
891.31Scgd		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