Commit | Line | Data |
---|---|---|
7d80f297 | 1 | # @(#)Makefile 5.43 (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 \ |
7d80f297 KB |
11 | fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h math.h memory.h \ |
12 | mp.h ndbm.h netdb.h nlist.h paths.h pcc.h pwd.h ranlib.h regexp.h \ | |
ac1f33de KB |
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 \ | |
c8e43846 | 15 | tzfile.h unistd.h utime.h utmp.h varargs.h vfont.h vis.h |
7d80f297 | 16 | |
b30a8460 | 17 | MFILES= float.h frame.h |
c8e43846 | 18 | LFILES= errno.h fcntl.h signal.h syslog.h termios.h |
5a9c27d0 | 19 | |
b30a8460 | 20 | DIRS=arpa protocols |
c8e43846 | 21 | LDIRS= net netimp netinet netiso netns nfs sys ufs |
f067c19e | 22 | |
b30a8460 KB |
23 | NOOBJ= noobj |
24 | ||
770d844a KB |
25 | # Define SHARED to indicate whether you want symbolic links to the system |
26 | # source (``symlinks''), or a separate copy (``copies''); (latter useful | |
27 | # in environments where it's not possible to keep /sys publicly readable) | |
28 | # SHARED= copies | |
29 | SHARED= symlinks | |
f067c19e BJ |
30 | |
31 | install: ${SHARED} | |
b30a8460 KB |
32 | @echo installing ${FILES} |
33 | @-for i in ${FILES}; do \ | |
c8c70607 | 34 | cmp -s $$i ${DESTDIR}/usr/include/$$i || \ |
770d844a KB |
35 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ |
36 | ${DESTDIR}/usr/include/$$i; \ | |
f067c19e | 37 | done |
b30a8460 KB |
38 | @echo installing ${DIRS} |
39 | @-for i in ${DIRS}; do \ | |
f067c19e BJ |
40 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ |
41 | then \ | |
42 | mkdir ${DESTDIR}/usr/include/$$i; \ | |
43 | fi; \ | |
770d844a KB |
44 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
45 | chmod 755 ${DESTDIR}/usr/include/$$i; \ | |
f62b324d | 46 | (cd $$i; for j in *.[ih]; do \ |
c8c70607 | 47 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ |
770d844a KB |
48 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ |
49 | ${DESTDIR}/usr/include/$$i/$$j; \ | |
f067c19e BJ |
50 | done); \ |
51 | done | |
b30a8460 KB |
52 | @echo installing ${LFILES} |
53 | @-for i in ${LFILES}; do \ | |
f067c19e BJ |
54 | rm -f ${DESTDIR}/usr/include/$$i; \ |
55 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 56 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
f067c19e | 57 | done |
b30a8460 KB |
58 | @echo installing ${MFILES} |
59 | @-for i in ${MFILES}; do \ | |
c20c0f11 KB |
60 | rm -f ${DESTDIR}/usr/include/$$i; \ |
61 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ | |
599715c8 | 62 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
c20c0f11 | 63 | done |
f067c19e | 64 | |
ac1f33de | 65 | copies: |
c8e43846 | 66 | @echo copies: ${LDIRS} |
b30a8460 | 67 | @-for i in ${LDIRS}; do \ |
ac1f33de KB |
68 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
69 | cd /sys; \ | |
70 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
71 | done | |
b30a8460 KB |
72 | rm -f ${DESTDIR}/usr/include/machine |
73 | mkdir ${DESTDIR}/usr/include/machine | |
74 | cd /sys/${MACHINE}/include; \ | |
75 | tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \ | |
f067c19e | 76 | |
b30a8460 KB |
77 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
78 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
79 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
5a9c27d0 | 80 | done |
b30a8460 KB |
81 | rm -f ${DESTDIR}/usr/include/machine |
82 | ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine | |
83 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine | |
5a9c27d0 | 84 | |
2716b41c | 85 | .include <bsd.prog.mk> |