Commit | Line | Data |
---|---|---|
64f91939 | 1 | # @(#)Makefile 8.2 (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 | ||
bc668998 KB |
10 | # Missing: mp.h |
11 | ||
b30a8460 | 12 | FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ |
c0bb215a | 13 | err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \ |
e52d7be4 | 14 | math.h memory.h mp.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h \ |
1494221c KB |
15 | ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h \ |
16 | sgtty.h signal.h stab.h stddef.h stdio.h stdlib.h string.h strings.h \ | |
64f91939 KB |
17 | struct.h sysexits.h tar.h time.h ttyent.h tzfile.h unistd.h utime.h \ |
18 | utmp.h vis.h | |
7d80f297 | 19 | |
b3160050 | 20 | MFILES= float.h frame.h stdarg.h varargs.h |
7127755a | 21 | LFILES= errno.h fcntl.h syslog.h termios.h |
5a9c27d0 | 22 | |
b30a8460 | 23 | DIRS=arpa protocols |
bfb4fbd1 | 24 | LDIRS= net netccitt netinet netiso netns nfs sys ufs vm |
f067c19e | 25 | |
b30a8460 KB |
26 | NOOBJ= noobj |
27 | ||
770d844a KB |
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 | |
f067c19e BJ |
33 | |
34 | install: ${SHARED} | |
b30a8460 KB |
35 | @echo installing ${FILES} |
36 | @-for i in ${FILES}; do \ | |
8e3cc25f | 37 | cmp -s $$i ${DESTDIR}/usr/include/$$i > /dev/null 2>&1 || \ |
770d844a KB |
38 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ |
39 | ${DESTDIR}/usr/include/$$i; \ | |
f067c19e | 40 | done |
b30a8460 KB |
41 | @echo installing ${DIRS} |
42 | @-for i in ${DIRS}; do \ | |
f067c19e BJ |
43 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ |
44 | then \ | |
45 | mkdir ${DESTDIR}/usr/include/$$i; \ | |
46 | fi; \ | |
770d844a KB |
47 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
48 | chmod 755 ${DESTDIR}/usr/include/$$i; \ | |
f62b324d | 49 | (cd $$i; for j in *.[ih]; do \ |
8e3cc25f KB |
50 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j > \ |
51 | /dev/null 2>&1 || \ | |
52 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ | |
770d844a | 53 | ${DESTDIR}/usr/include/$$i/$$j; \ |
f067c19e BJ |
54 | done); \ |
55 | done | |
b30a8460 KB |
56 | @echo installing ${LFILES} |
57 | @-for i in ${LFILES}; do \ | |
f067c19e BJ |
58 | rm -f ${DESTDIR}/usr/include/$$i; \ |
59 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 60 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
f067c19e | 61 | done |
b30a8460 KB |
62 | @echo installing ${MFILES} |
63 | @-for i in ${MFILES}; do \ | |
c20c0f11 KB |
64 | rm -f ${DESTDIR}/usr/include/$$i; \ |
65 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 66 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
c20c0f11 | 67 | done |
f067c19e | 68 | |
ac1f33de | 69 | copies: |
c8e43846 | 70 | @echo copies: ${LDIRS} |
b30a8460 | 71 | @-for i in ${LDIRS}; do \ |
ac1f33de KB |
72 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
73 | cd /sys; \ | |
06d90167 | 74 | tar Hcf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ |
ac1f33de | 75 | done |
b30a8460 KB |
76 | rm -f ${DESTDIR}/usr/include/machine |
77 | mkdir ${DESTDIR}/usr/include/machine | |
3e1bb8a7 | 78 | cd /sys/${MACHINE}/include && \ |
06d90167 | 79 | tar Hcf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); |
3e1bb8a7 KB |
80 | rm -f ${DESTDIR}/usr/include/X11 |
81 | mkdir ${DESTDIR}/usr/include/X11 | |
0542569d | 82 | cd /usr/X11/include/X11 && \ |
06d90167 | 83 | tar Hcf - *.h | (cd ${DESTDIR}/usr/include/X11; tar xpfB -); |
f067c19e | 84 | |
b30a8460 KB |
85 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
86 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
87 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
5a9c27d0 | 88 | done |
b30a8460 | 89 | rm -f ${DESTDIR}/usr/include/machine |
3e1bb8a7 KB |
90 | ln -s ${DESTDIR}/sys/${MACHINE}/include ${DESTDIR}/usr/include/machine |
91 | rm -f ${DESTDIR}/usr/include/X11 | |
bfefd0ca | 92 | ln -s ${DESTDIR}/usr/X11/include/X11 ${DESTDIR}/usr/include/X11 |
5a9c27d0 | 93 | |
2716b41c | 94 | .include <bsd.prog.mk> |