Commit | Line | Data |
---|---|---|
2005c53f | 1 | # @(#)Makefile 5.39 (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 |
8 | all clean cleandir depend lint tags: |
9 | ||
ede96f37 | 10 | SUBDIRS=arpa protocols |
2005c53f | 11 | STD= a.out.h ar.h assert.h bitstring.h ctype.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 | 17 | LMCH= float.h frame.h |
645b70bf | 18 | LSYS= errno.h fcntl.h signal.h syslog.h termios.h unistd.h |
2716b41c | 19 | NOOBJ= noobj |
5a9c27d0 | 20 | |
770d844a | 21 | DIRS= sys net netimp netinet netiso netns ufs nfs |
645b70bf KB |
22 | .if (${MACHINE} == "hp300") |
23 | DIRS+= hp300 hpdev | |
24 | .elif (${MACHINE} == "tahoe") | |
770d844a KB |
25 | DIRS+= tahoe tahoemath tahoevba tahoeif |
26 | .elif (${MACHINE} == "vax") | |
27 | DIRS+= 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 | |
34 | SHARED= symlinks | |
f067c19e | 35 | |
2716b41c KB |
36 | all include clean cleandir depend lint tags: |
37 | ||
f067c19e | 38 | install: ${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 | |
599715c8 | 63 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine; |
770d844a KB |
64 | @echo installing ${LSYS} |
65 | @-for i in ${LSYS}; do \ | |
f067c19e BJ |
66 | rm -f ${DESTDIR}/usr/include/$$i; \ |
67 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 68 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
f067c19e | 69 | done |
770d844a KB |
70 | @echo installing ${LMCH} |
71 | @-for i in ${LMCH}; do \ | |
c20c0f11 KB |
72 | rm -f ${DESTDIR}/usr/include/$$i; \ |
73 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 74 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
c20c0f11 | 75 | done |
f067c19e | 76 | |
f067c19e | 77 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
eb7574ea MK |
78 | if [ ! -s ${DESTDIR}/usr/include/$$i ]; \ |
79 | then \ | |
80 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 81 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
eb7574ea MK |
82 | else \ |
83 | echo ${DESTDIR}/usr/include/$$i not removed; \ | |
84 | fi; \ | |
f067c19e | 85 | done |
f067c19e | 86 | |
5a9c27d0 KB |
87 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
88 | cd /sys; \ | |
89 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
90 | done | |
91 | ||
2716b41c | 92 | .include <bsd.prog.mk> |