Home | History | Annotate | Line # | Download | only in include
Makefile revision 1.31
      1 #	from: @(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
      2 #	$Id: Makefile,v 1.31 1994/01/08 12:22:47 cgd Exp $
      3 
      4 # Doing a make install builds /usr/include
      5 #
      6 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
      7 # links.
      8 
      9 # Missing: mp.h
     10 
     11 FILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
     12 	err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
     13 	math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h \
     14 	regex.h resolv.h search.h setjmp.h sgtty.h stab.h stdarg.h stddef.h \
     15 	stdio.h stdlib.h string.h strings.h struct.h sysexits.h time.h \
     16 	ttyent.h tzfile.h unistd.h utime.h utmp.h varargs.h vis.h malloc.h \
     17 	link.h
     18 
     19 MFILES=	float.h frame.h
     20 LFILES=	errno.h fcntl.h signal.h syslog.h termios.h
     21 
     22 DIRS=	arpa protocols rpc rpcsvc
     23 LDIRS=	dev net netinet netccitt netiso netns nfs sys ufs vm 
     24 
     25 NOOBJ=	noobj
     26 
     27 # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
     28 .include <bsd.own.mk>
     29 SYS_INCLUDE?=	copies
     30 
     31 realinstall:
     32 	@echo installing ${FILES}
     33 	@-for i in ${FILES}; do \
     34 		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
     35 		    install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \
     36 	done
     37 	@echo installing ${DIRS}
     38 	@-for i in ${DIRS}; do \
     39 		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
     40 		then \
     41 			mkdir ${DESTDIR}/usr/include/$$i; \
     42 		fi; \
     43 		(cd $$i; for j in *.[ih]; do \
     44 			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
     45 			install -c -m 644 $$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 	@chmod -R a-w ${DESTDIR}/usr/include
     60 
     61 beforeinstall:
     62 	@install -d -o root -g wheel -m 755 ${DESTDIR}/usr/include
     63 
     64 copies:
     65 	@echo copies: ${LDIRS}
     66 	@-for i in ${LDIRS}; do \
     67 		rm -rf ${DESTDIR}/usr/include/$$i; \
     68 		cd ../sys; \
     69 		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
     70 	done
     71 	rm -rf ${DESTDIR}/usr/include/machine
     72 	mkdir ${DESTDIR}/usr/include/machine
     73 	cd ../sys/arch/${MACHINE}/include; \
     74 	    tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
     75 	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
     76 	if test ${MACHINE} != ${MACHINE_ARCH} ; then \
     77 		mkdir ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
     78 		cd ../sys/arch/${MACHINE_ARCH}/include ; \
     79 		tar cf - *.h | \
     80 		    (cd ${DESTDIR}/usr/include/${MACHINE_ARCH} ; tar xpfB -); \
     81 	else \
     82 		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
     83 	fi
     84 
     85 symlinks:
     86 	@echo symlinks: ${LDIRS}
     87 	@for i in ${LDIRS}; do \
     88 		rm -rf ${DESTDIR}/usr/include/$$i; \
     89 		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
     90 	done
     91 	rm -rf ${DESTDIR}/usr/include/machine
     92 	ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/machine
     93 	rm -rf ${DESTDIR}/usr/include/${MACHINE_ARCH}
     94 	if test ${MACHINE} != ${MACHINE_ARCH} ; then \
     95 		ln -s /sys/arch/${MACHINE_ARCH}/include \
     96 		    ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
     97 	else \
     98 		ln -s machine ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
     99 	fi
    100 
    101 .include <bsd.prog.mk>
    102 
    103 realinstall: ${SYS_INCLUDE}
    104