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