Home | History | Annotate | Line # | Download | only in include
Makefile revision 1.11
      1 #	@(#)Makefile	5.45.1.1 (Berkeley) 5/6/91
      2 #
      3 # Doing a make install builds /usr/include
      4 #
      5 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
      6 # links.
      7 #
      8 
      9 SUBDIR= rpcsvc
     10 
     11 # Missing: mp.h
     12 
     13 FILES=	a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
     14 	fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h math.h memory.h \
     15 	mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h ranlib.h regexp.h \
     16 	resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \
     17 	stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \
     18 	tzfile.h unistd.h utime.h utmp.h varargs.h vis.h
     19 
     20 MFILES=	float.h frame.h
     21 LFILES=	errno.h fcntl.h signal.h syslog.h termios.h
     22 
     23 DIRS=arpa protocols
     24 LDIRS=	net netinet netccitt netiso netns nfs sys ufs vm 
     25 
     26 NOOBJ=	noobj
     27 
     28 # Define SHARED to indicate whether you want symbolic links to the system
     29 # source (``symlinks''), or a separate copy (``copies''); (latter useful
     30 # in environments where it's not possible to keep /sys publicly readable)
     31 SHARED= 	copies
     32 #SHARED= 	symlinks
     33 
     34 install: beforeinstall _PROGSUBDIR ${SHARED}
     35 	@echo installing ${FILES}
     36 	@-for i in ${FILES}; do \
     37 		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
     38 		    install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
     39 		    ${DESTDIR}/usr/include/$$i; \
     40 	done
     41 	@echo installing ${DIRS}
     42 	@-for i in ${DIRS}; do \
     43 		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
     44 		then \
     45 			mkdir ${DESTDIR}/usr/include/$$i; \
     46 		fi; \
     47 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     48 		chmod 755 ${DESTDIR}/usr/include/$$i; \
     49 		(cd $$i; for j in *.[ih]; do \
     50 			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
     51 			install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
     52 			    ${DESTDIR}/usr/include/$$i/$$j; \
     53 		done); \
     54 	done
     55 	@echo installing ${LFILES}
     56 	@-for i in ${LFILES}; do \
     57 		rm -f ${DESTDIR}/usr/include/$$i; \
     58 		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
     59 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     60 	done
     61 	@echo installing ${MFILES}
     62 	@-for i in ${MFILES}; do \
     63 		rm -f ${DESTDIR}/usr/include/$$i; \
     64 		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
     65 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     66 	done
     67 
     68 beforeinstall:
     69 	@if [ ! -d ${DESTDIR}/usr/include ]; then \
     70                 /bin/rm -f ${DESTDIR}/usr/include ; \
     71                 mkdir -p ${DESTDIR}/usr/include ; \
     72                 chown root.wheel ${DESTDIR}/usr/include ; \
     73                 chmod 755 ${DESTDIR}/usr/include ; \
     74         else \
     75                 true ; \
     76         fi
     77 
     78 copies:
     79 	@echo copies: ${LDIRS}
     80 	@-for i in ${LDIRS}; do \
     81 		rm -rf ${DESTDIR}/usr/include/$$i; \
     82 		cd ../sys; \
     83 		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
     84 	done
     85 	rm -rf ${DESTDIR}/usr/include/machine
     86 	mkdir ${DESTDIR}/usr/include/machine
     87 	cd ../sys/${MACHINE}/include; \
     88 	tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \
     89 
     90 symlinks:
     91 	@echo symlinks: ${LDIRS}
     92 	@for i in ${LDIRS}; do \
     93 		rm -rf ${DESTDIR}/usr/include/$$i; \
     94 		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
     95 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     96 	done
     97 	rm -rf ${DESTDIR}/usr/include/machine
     98 	ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
     99 	chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine
    100 
    101 .include <bsd.prog.mk>
    102