Home | History | Annotate | Line # | Download | only in include
Makefile revision 1.8
      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 	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 # Missing: netimp netiso netns
     25 LDIRS=	net netinet nfs sys ufs vm
     26 
     27 NOOBJ=	noobj
     28 
     29 # Define SHARED to indicate whether you want symbolic links to the system
     30 # source (``symlinks''), or a separate copy (``copies''); (latter useful
     31 # in environments where it's not possible to keep /sys publicly readable)
     32 SHARED= 	copies
     33 #SHARED= 	symlinks
     34 
     35 install: beforeinstall _PROGSUBDIR ${SHARED}
     36 	@echo installing ${FILES}
     37 	@-for i in ${FILES}; do \
     38 		cmp -s $$i ${DESTDIR}/usr/include/$$i || \
     39 		    install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
     40 		    ${DESTDIR}/usr/include/$$i; \
     41 	done
     42 	@echo installing ${DIRS}
     43 	@-for i in ${DIRS}; do \
     44 		if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
     45 		then \
     46 			mkdir ${DESTDIR}/usr/include/$$i; \
     47 		fi; \
     48 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     49 		chmod 755 ${DESTDIR}/usr/include/$$i; \
     50 		(cd $$i; for j in *.[ih]; do \
     51 			cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
     52 			install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
     53 			    ${DESTDIR}/usr/include/$$i/$$j; \
     54 		done); \
     55 	done
     56 	@echo installing ${LFILES}
     57 	@-for i in ${LFILES}; do \
     58 		rm -f ${DESTDIR}/usr/include/$$i; \
     59 		ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
     60 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     61 	done
     62 	@echo installing ${MFILES}
     63 	@-for i in ${MFILES}; do \
     64 		rm -f ${DESTDIR}/usr/include/$$i; \
     65 		ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
     66 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     67 	done
     68 
     69 beforeinstall:
     70 	@if [ ! -d ${DESTDIR}/usr/include ]; then \
     71                 /bin/rm -f ${DESTDIR}/usr/include ; \
     72                 mkdir -p ${DESTDIR}/usr/include ; \
     73                 chown root.wheel ${DESTDIR}/usr/include ; \
     74                 chmod 755 ${DESTDIR}/usr/include ; \
     75         else \
     76                 true ; \
     77         fi
     78 
     79 copies:
     80 	@echo copies: ${LDIRS}
     81 	@-for i in ${LDIRS}; do \
     82 		rm -rf ${DESTDIR}/usr/include/$$i; \
     83 		cd ../sys.386bsd; \
     84 		tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
     85 	done
     86 	rm -rf ${DESTDIR}/usr/include/machine
     87 	mkdir ${DESTDIR}/usr/include/machine
     88 	cd ../sys.386bsd/${MACHINE}/include; \
     89 	tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \
     90 
     91 symlinks:
     92 	@echo symlinks: ${LDIRS}
     93 	@for i in ${LDIRS}; do \
     94 		rm -rf ${DESTDIR}/usr/include/$$i; \
     95 		ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
     96 		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
     97 	done
     98 	rm -rf ${DESTDIR}/usr/include/machine
     99 	ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
    100 	chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine
    101 
    102 .include <bsd.prog.mk>
    103