Home | History | Annotate | Line # | Download | only in include
Makefile revision 1.54
      1 #	$NetBSD: Makefile,v 1.54 1995/04/16 19:03:55 mycroft Exp $
      2 
      3 #	@(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
      4 
      5 # Doing a make install builds /usr/include
      6 #
      7 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
      8 # links.
      9 
     10 # Missing: mp.h
     11 
     12 FILES=	a.out.h ar.h assert.h bitstring.h bm.h ctype.h db.h dirent.h disktab.h \
     13 	err.h fnmatch.h fstab.h fts.h glob.h grp.h ieeefp.h iso646.h kvm.h \
     14 	langinfo.h limits.h locale.h math.h memory.h mpool.h ndbm.h netdb.h \
     15 	netgroup.h nlist.h nl_types.h paths.h pwd.h ranlib.h regex.h regexp.h \
     16 	resolv.h search.h setjmp.h sgtty.h signal.h stab.h stddef.h \
     17 	stdio.h stdlib.h string.h strings.h struct.h sysexits.h time.h \
     18 	ttyent.h tzfile.h unistd.h utime.h utmp.h vis.h malloc.h \
     19 	link.h
     20 
     21 MFILES=	float.h frame.h stdarg.h varargs.h
     22 LFILES=	errno.h fcntl.h syslog.h termios.h
     23 
     24 DIRS=	arpa protocols rpc rpcsvc
     25 LDIRS=	dev net netinet netccitt netiso netns nfs sys ufs vm 
     26 
     27 NOOBJ=	noobj
     28 
     29 # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
     30 .include <bsd.own.mk>
     31 SYS_INCLUDE?=	copies
     32 
     33 realinstall:
     34 	@echo installing ${FILES}
     35 	@-for i in ${FILES}; do \
     36 		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
     37 		    install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \
     38 	done
     39 	@echo installing ${DIRS}
     40 	@-for i in ${DIRS}; do \
     41 		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
     42 			${DESTDIR}/usr/include/$$i; \
     43 		(cd $$i; for j in *.[ih]; do \
     44 			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
     45 			install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
     46 		done); \
     47 	done
     48 	@echo installing ${LFILES}
     49 	@-for i in ${LFILES}; do \
     50 		rm -f ${DESTDIR}/usr/include/$$i; \
     51 		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
     52 	done
     53 	@echo installing ${MFILES}
     54 	@-for i in ${MFILES}; do \
     55 		rm -f ${DESTDIR}/usr/include/$$i; \
     56 		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
     57 	done
     58 	chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
     59 	find ${DESTDIR}/usr/include -type f | \
     60 		xargs chmod a=r
     61 	find ${DESTDIR}/usr/include -type d | \
     62 		xargs chmod u=rwx,go=rx
     63 
     64 beforeinstall:
     65 	install -d -o ${BINOWN} -g ${BINGRP} -m 755 ${DESTDIR}/usr/include
     66 
     67 copies:
     68 	@echo copies: ${LDIRS}
     69 	@-for i in ${LDIRS}; do \
     70 		rm -rf ${DESTDIR}/usr/include/$$i; \
     71 		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
     72 			${DESTDIR}/usr/include/$$i ; \
     73 	done
     74 	cd ../sys; \
     75 	pax -rw -pa -L \
     76 	    `find ${LDIRS} -follow -type f -name '*.h' '!' -path \
     77 	    'netiso/xebec/*' -print` ${DESTDIR}/usr/include
     78 	rm -rf ${DESTDIR}/usr/include/machine
     79 	install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
     80 		${DESTDIR}/usr/include/machine
     81 	pax -rw -pa -s "|../sys/arch/${MACHINE}/include||" \
     82 	    ../sys/arch/${MACHINE}/include/*.h \
     83 	    ${DESTDIR}/usr/include/machine   
     84 	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
     85 	if test ${MACHINE} != ${MACHINE_ARCH} -a \
     86 	    -d ../sys/arch/${MACHINE_ARCH}/include; then \
     87 		install -d -o ${BINOWN} -g ${BINGRP} -m 755 \
     88     	    	    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
     89 		pax -rw -pa -s "|../sys/arch/${MACHINE_ARCH}/include||" \
     90 		    ../sys/arch/${MACHINE_ARCH}/include/*.h \
     91 		    ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
     92 	else \
     93 		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
     94 	fi
     95 
     96 symlinks:
     97 	@echo symlinks: ${LDIRS}
     98 	@for i in ${LDIRS}; do \
     99 		rm -rf ${DESTDIR}/usr/include/$$i; \
    100 		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
    101 	done
    102 	rm -rf ${DESTDIR}/usr/include/machine
    103 	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
    104 	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
    105 	if test ${MACHINE} != ${MACHINE_ARCH} -a \
    106 	    -d ../sys/arch/${MACHINE_ARCH}/include ; then \
    107 		ln -s /sys/arch/${MACHINE_ARCH}/include \
    108 		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
    109 	else \
    110 		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
    111 	fi
    112 
    113 .include <bsd.prog.mk>
    114 
    115 realinstall: ${SYS_INCLUDE}
    116