Makefile revision 1.26
11.21Smycroft#	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
21.26Scgd#	$Id: Makefile,v 1.26 1993/10/09 23:28:14 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.12Smycroft	regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \
151.1Scgd	stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \
161.17Sderaadt	tzfile.h unistd.h utime.h utmp.h varargs.h vis.h malloc.h
171.1Scgd
181.1ScgdMFILES=	float.h frame.h
191.1ScgdLFILES=	errno.h fcntl.h signal.h syslog.h termios.h
201.1Scgd
211.26ScgdDIRS=	arpa protocols rpc rpcsvc
221.9ScgdLDIRS=	net netinet netccitt netiso netns nfs sys ufs vm 
231.1Scgd
241.1ScgdNOOBJ=	noobj
251.1Scgd
261.20Sbrezak# Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
271.20Sbrezak.if !defined(SYS_INCLUDE)
281.20SbrezakSYS_INCLUDE=	copies
291.20Sbrezak.endif
301.1Scgd
311.22Smycroftrealinstall:
321.1Scgd	@echo installing ${FILES}
331.1Scgd	@-for i in ${FILES}; do \
341.1Scgd		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
351.18Sderaadt		    install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \
361.1Scgd	done
371.1Scgd	@echo installing ${DIRS}
381.1Scgd	@-for i in ${DIRS}; do \
391.1Scgd		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
401.1Scgd		then \
411.1Scgd			mkdir ${DESTDIR}/usr/include/$$i; \
421.1Scgd		fi; \
431.1Scgd		(cd $$i; for j in *.[ih]; do \
441.1Scgd			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
451.18Sderaadt			install -c -m 644 $$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.24Sjtc	@chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
591.13Sproven	@chmod -R a-w ${DESTDIR}/usr/include
601.1Scgd
611.8Scgdbeforeinstall:
621.23Smycroft	@install -d -o root -g wheel -m 755 ${DESTDIR}/usr/include
631.8Scgd
641.1Scgdcopies:
651.1Scgd	@echo copies: ${LDIRS}
661.1Scgd	@-for i in ${LDIRS}; do \
671.1Scgd		rm -rf ${DESTDIR}/usr/include/$$i; \
681.11Scgd		cd ../sys; \
691.1Scgd		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
701.1Scgd	done
711.3Scgd	rm -rf ${DESTDIR}/usr/include/machine
721.1Scgd	mkdir ${DESTDIR}/usr/include/machine
731.16Scgd	cd ../sys/arch/${MACHINE}/include; \
741.1Scgd	tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \
751.1Scgd
761.1Scgdsymlinks:
771.1Scgd	@echo symlinks: ${LDIRS}
781.13Sproven	@for i in ${LDIRS}; do \
791.13Sproven		rm -rf ${DESTDIR}/usr/include/$$i; \
801.13Sproven		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
811.13Sproven	done
821.13Sproven	rm -rf ${DESTDIR}/usr/include/machine
831.16Scgd	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
841.14Sproven
851.14Sproven.include <bsd.prog.mk>
861.23Smycroft
871.23Smycroftrealinstall: ${SYS_INCLUDE}
88