date and time created 90/06/25 13:56:22 by bostic
[unix-history] / usr / src / include / Makefile
CommitLineData
2716b41c 1# @(#)Makefile 5.36 (Berkeley) %G%
f067c19e
BJ
2#
3# Doing a make install builds /usr/include
4#
770d844a
KB
5# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
6# links.
f067c19e 7#
770d844a
KB
8all clean cleandir depend lint tags:
9
9b051870 10SUBDIRS=arpa pascal protocols
6e89d646 11STD= a.out.h ar.h assert.h bitstring.h ctype.h curses.h ndbm.h \
56237b81 12 dirent.h disktab.h fstab.h fts.h glob.h grp.h kvm.h limits.h \
770d844a 13 math.h memory.h mp.h netdb.h nlist.h paths.h pcc.h pwd.h ranlib.h \
6e89d646
KB
14 regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h \
15 stdlib.h stdio.h string.h strings.h struct.h sysexits.h time.h \
16 ttyent.h tzfile.h utmp.h varargs.h vfont.h vis.h
770d844a 17LMCH= float.h frame.h
645b70bf 18LSYS= errno.h fcntl.h signal.h syslog.h termios.h unistd.h
2716b41c 19NOOBJ= noobj
5a9c27d0 20
770d844a 21DIRS= sys net netimp netinet netiso netns ufs nfs
645b70bf
KB
22.if (${MACHINE} == "hp300")
23DIRS+= hp300 hpdev
24.elif (${MACHINE} == "tahoe")
770d844a
KB
25DIRS+= tahoe tahoemath tahoevba tahoeif
26.elif (${MACHINE} == "vax")
27DIRS+= vax vaxmba vaxuba vaxif
28.endif
f067c19e 29
770d844a
KB
30# Define SHARED to indicate whether you want symbolic links to the system
31# source (``symlinks''), or a separate copy (``copies''); (latter useful
32# in environments where it's not possible to keep /sys publicly readable)
33# SHARED= copies
34SHARED= symlinks
f067c19e 35
2716b41c
KB
36all include clean cleandir depend lint tags:
37
f067c19e 38install: ${SHARED}
770d844a
KB
39 @echo installing ${STD}
40 @-for i in ${STD}; do \
c8c70607 41 cmp -s $$i ${DESTDIR}/usr/include/$$i || \
770d844a
KB
42 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
43 ${DESTDIR}/usr/include/$$i; \
f067c19e 44 done
770d844a
KB
45 @echo installing ${SUBDIRS}
46 @-for i in ${SUBDIRS}; do \
f067c19e
BJ
47 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
48 then \
49 mkdir ${DESTDIR}/usr/include/$$i; \
50 fi; \
770d844a
KB
51 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
52 chmod 755 ${DESTDIR}/usr/include/$$i; \
f62b324d 53 (cd $$i; for j in *.[ih]; do \
c8c70607 54 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
770d844a
KB
55 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
56 ${DESTDIR}/usr/include/$$i/$$j; \
f067c19e
BJ
57 done); \
58 done
770d844a
KB
59 install -c -o ${BINOWN} -g ${BINGRP} -m 444 Makefile.install \
60 ${DESTDIR}/usr/include/Makefile
c20c0f11
KB
61 rm -f ${DESTDIR}/usr/include/machine
62 ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine
770d844a
KB
63 @echo installing ${LSYS}
64 @-for i in ${LSYS}; do \
f067c19e
BJ
65 rm -f ${DESTDIR}/usr/include/$$i; \
66 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
67 done
770d844a
KB
68 @echo installing ${LMCH}
69 @-for i in ${LMCH}; do \
c20c0f11
KB
70 rm -f ${DESTDIR}/usr/include/$$i; \
71 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
72 done
f067c19e 73
f067c19e 74 rm -rf ${DESTDIR}/usr/include/$$i; \
eb7574ea
MK
75 if [ ! -s ${DESTDIR}/usr/include/$$i ]; \
76 then \
77 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
78 else \
79 echo ${DESTDIR}/usr/include/$$i not removed; \
80 fi; \
f067c19e 81 done
f067c19e 82
5a9c27d0
KB
83 rm -rf ${DESTDIR}/usr/include/$$i; \
84 cd /sys; \
85 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
86 done
87
2716b41c 88.include <bsd.prog.mk>