xref: /csrg-svn/include/Makefile (revision 65400)
1*65400Sbostic#	@(#)Makefile	8.2 (Berkeley) 01/04/94
213581Sroot#
313581Sroot# Doing a make install builds /usr/include
413581Sroot#
541615Sbostic# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
641615Sbostic# links.
713581Sroot#
841615Sbosticall clean cleandir depend lint tags:
941615Sbostic
1045871SbosticFILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
1158448Sbostic	err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
1255841Sbostic	math.h memory.h mp.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h \
1360526Sbostic	ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h \
1460526Sbostic	sgtty.h signal.h stab.h stddef.h stdio.h stdlib.h string.h strings.h \
15*65400Sbostic	struct.h sysexits.h tar.h time.h ttyent.h tzfile.h unistd.h utime.h \
16*65400Sbostic	utmp.h vis.h
1747027Sbostic
1852585SbosticMFILES=	float.h frame.h stdarg.h varargs.h
1950751SbosticLFILES=	errno.h fcntl.h syslog.h termios.h
2031348Sbostic
2145871SbosticDIRS=arpa protocols
2261014SbosticLDIRS=	net netccitt netinet netiso netns nfs sys ufs vm
2341615Sbostic
2445871SbosticNOOBJ=	noobj
2545871Sbostic
2641615Sbostic# Define SHARED to indicate whether you want symbolic links to the system
2741615Sbostic# source (``symlinks''), or a separate copy (``copies''); (latter useful
2841615Sbostic# in environments where it's not possible to keep /sys publicly readable)
2941615Sbostic# SHARED=	copies
3013581SrootSHARED=	symlinks
3113581Sroot
3213581Srootinstall: ${SHARED}
3345871Sbostic	@echo installing ${FILES}
3445871Sbostic	@-for i in ${FILES}; do \
3555222Sbostic		cmp -s $$i ${DESTDIR}/usr/include/$$i > /dev/null 2>&1 || \
3641615Sbostic		    install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
3741615Sbostic		    ${DESTDIR}/usr/include/$$i; \
3813581Sroot	done
3945871Sbostic	@echo installing ${DIRS}
4045871Sbostic	@-for i in ${DIRS}; do \
4113581Sroot		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
4213581Sroot		then \
4313581Sroot			mkdir ${DESTDIR}/usr/include/$$i; \
4413581Sroot		fi; \
4541615Sbostic		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
4641615Sbostic		chmod 755 ${DESTDIR}/usr/include/$$i; \
4714303Ssam		(cd $$i; for j in *.[ih]; do \
4855222Sbostic			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j > \
4955222Sbostic			    /dev/null 2>&1 || \
5055222Sbostic			    install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
5141615Sbostic			    ${DESTDIR}/usr/include/$$i/$$j; \
5213581Sroot		done); \
5313581Sroot	done
5445871Sbostic	@echo installing ${LFILES}
5545871Sbostic	@-for i in ${LFILES}; do \
5613581Sroot		rm -f ${DESTDIR}/usr/include/$$i; \
5713581Sroot		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
5844276Sbostic		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
5913581Sroot	done
6045871Sbostic	@echo installing ${MFILES}
6145871Sbostic	@-for i in ${MFILES}; do \
6238631Sbostic		rm -f ${DESTDIR}/usr/include/$$i; \
6338631Sbostic		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
6444276Sbostic		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
6538631Sbostic	done
6613581Sroot
6745205Sbosticcopies:
6846961Sbostic	@echo copies: ${LDIRS}
6945871Sbostic	@-for i in ${LDIRS}; do \
7045205Sbostic		rm -rf ${DESTDIR}/usr/include/$$i; \
7145205Sbostic		cd /sys; \
7260530Sbostic		tar Hcf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
7345205Sbostic	done
7445871Sbostic	rm -f ${DESTDIR}/usr/include/machine
7545871Sbostic	mkdir ${DESTDIR}/usr/include/machine
7655285Sbostic	cd /sys/${MACHINE}/include && \
7760530Sbostic	    tar Hcf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
7855285Sbostic	rm -f ${DESTDIR}/usr/include/X11
7955285Sbostic	mkdir ${DESTDIR}/usr/include/X11
8063130Sbostic	cd /usr/X11/include/X11 && \
8160530Sbostic	    tar Hcf - *.h | (cd ${DESTDIR}/usr/include/X11; tar xpfB -);
8245205Sbostic
8341615Sbosticsymlinks:
8446961Sbostic	@echo symlinks: ${LDIRS}
8545871Sbostic	@for i in ${LDIRS}; do \
8613581Sroot		rm -rf ${DESTDIR}/usr/include/$$i; \
8745871Sbostic		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
8845871Sbostic		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
8913581Sroot	done
9045871Sbostic	rm -f ${DESTDIR}/usr/include/machine
9155285Sbostic	ln -s ${DESTDIR}/sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
9255285Sbostic	rm -f ${DESTDIR}/usr/include/X11
9363131Sbostic	ln -s ${DESTDIR}/usr/X11/include/X11 ${DESTDIR}/usr/include/X11
9431348Sbostic
9543032Sbostic.include <bsd.prog.mk>
96