Commit | Line | Data |
---|---|---|
b30a8460 | 1 | # @(#)Makefile 5.41 (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 | ||
b30a8460 | 10 | FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ |
ac1f33de KB |
11 | fstab.h fts.h glob.h grp.h kvm.h limits.h math.h memory.h mp.h \ |
12 | ndbm.h netdb.h nlist.h paths.h pcc.h pwd.h ranlib.h regexp.h \ | |
13 | resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \ | |
14 | stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \ | |
15 | tzfile.h utmp.h varargs.h vfont.h vis.h | |
b30a8460 KB |
16 | MFILES= float.h frame.h |
17 | LFILES= errno.h fcntl.h signal.h syslog.h termios.h unistd.h | |
5a9c27d0 | 18 | |
b30a8460 KB |
19 | DIRS=arpa protocols |
20 | LDIRS= sys net netimp netinet netiso netns ufs nfs | |
21 | .if (${MACHINE} == "i386") | |
22 | MDIRS= i386 | |
23 | .elif (${MACHINE} == "hp300") | |
24 | MDIRS= hp300 dev | |
645b70bf | 25 | .elif (${MACHINE} == "tahoe") |
b30a8460 | 26 | MDIRS= tahoe math vba if |
770d844a | 27 | .elif (${MACHINE} == "vax") |
b30a8460 | 28 | MDIRS= vax bi if mba uba |
770d844a | 29 | .endif |
f067c19e | 30 | |
b30a8460 KB |
31 | NOOBJ= noobj |
32 | ||
770d844a KB |
33 | # Define SHARED to indicate whether you want symbolic links to the system |
34 | # source (``symlinks''), or a separate copy (``copies''); (latter useful | |
35 | # in environments where it's not possible to keep /sys publicly readable) | |
36 | # SHARED= copies | |
37 | SHARED= symlinks | |
f067c19e BJ |
38 | |
39 | install: ${SHARED} | |
b30a8460 KB |
40 | @echo installing ${FILES} |
41 | @-for i in ${FILES}; do \ | |
c8c70607 | 42 | cmp -s $$i ${DESTDIR}/usr/include/$$i || \ |
770d844a KB |
43 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ |
44 | ${DESTDIR}/usr/include/$$i; \ | |
f067c19e | 45 | done |
b30a8460 KB |
46 | @echo installing ${DIRS} |
47 | @-for i in ${DIRS}; do \ | |
f067c19e BJ |
48 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ |
49 | then \ | |
50 | mkdir ${DESTDIR}/usr/include/$$i; \ | |
51 | fi; \ | |
770d844a KB |
52 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
53 | chmod 755 ${DESTDIR}/usr/include/$$i; \ | |
f62b324d | 54 | (cd $$i; for j in *.[ih]; do \ |
c8c70607 | 55 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ |
770d844a KB |
56 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ |
57 | ${DESTDIR}/usr/include/$$i/$$j; \ | |
f067c19e BJ |
58 | done); \ |
59 | done | |
b30a8460 KB |
60 | @echo installing ${LFILES} |
61 | @-for i in ${LFILES}; do \ | |
f067c19e BJ |
62 | rm -f ${DESTDIR}/usr/include/$$i; \ |
63 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 64 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
f067c19e | 65 | done |
b30a8460 KB |
66 | @echo installing ${MFILES} |
67 | @-for i in ${MFILES}; do \ | |
c20c0f11 KB |
68 | rm -f ${DESTDIR}/usr/include/$$i; \ |
69 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 70 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
c20c0f11 | 71 | done |
f067c19e | 72 | |
ac1f33de | 73 | copies: |
b30a8460 KB |
74 | @echo copies: ${LDIRS} ${MDIRS} |
75 | @-for i in ${LDIRS}; do \ | |
ac1f33de KB |
76 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
77 | cd /sys; \ | |
78 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
79 | done | |
b30a8460 | 80 | @-for i in ${MDIRS}; do \ |
f067c19e | 81 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
b30a8460 KB |
82 | cd /sys/${MACHINE}; \ |
83 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
f067c19e | 84 | done |
b30a8460 KB |
85 | rm -f ${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 -); \ | |
f067c19e | 89 | |
b30a8460 KB |
90 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
91 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
92 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
5a9c27d0 | 93 | done |
b30a8460 KB |
94 | @for i in ${MDIRS}; do \ |
95 | rm -rf ${DESTDIR}/usr/include/$$i; \ | |
96 | ln -s /sys/${MACHINE}/$$i ${DESTDIR}/usr/include/$$i; \ | |
97 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
98 | done | |
99 | rm -f ${DESTDIR}/usr/include/machine | |
100 | ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine | |
101 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine | |
5a9c27d0 | 102 | |
2716b41c | 103 | .include <bsd.prog.mk> |