Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | # @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91 |
2 | # | |
2949bf6a | 3 | # The ``rm -rf''s used below are safe because rm doesn't follow symbolic |
15637ed4 RG |
4 | # links. |
5 | # | |
6 | all clean cleandir depend lint tags: | |
7 | ||
8 | # Missing: mp.h | |
9 | ||
10 | FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ | |
bdd191e5 NW |
11 | err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \ |
12 | math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h \ | |
13 | ranlib.h regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h \ | |
14 | stddef.h stdio.h stdlib.h string.h strings.h struct.h sysexits.h \ | |
15 | time.h ttyent.h tzfile.h unistd.h utime.h utmp.h varargs.h vis.h | |
15637ed4 RG |
16 | |
17 | MFILES= float.h frame.h | |
f0f4e3ed | 18 | LFILES= errno.h fcntl.h signal.h syslog.h syscall.h termios.h |
15637ed4 RG |
19 | |
20 | DIRS=arpa protocols | |
9241bfd5 RM |
21 | LDIRS= net netccitt netinet netiso netns nfs sys ufs vm |
22 | # removed netimp depricated? | |
15637ed4 RG |
23 | |
24 | NOOBJ= noobj | |
25 | ||
26 | # Define SHARED to indicate whether you want symbolic links to the system | |
27 | # source (``symlinks''), or a separate copy (``copies''); (latter useful | |
28 | # in environments where it's not possible to keep /sys publicly readable) | |
29 | # SHARED= copies | |
17ea84d8 | 30 | SHARED?= symlinks |
15637ed4 RG |
31 | |
32 | install: ${SHARED} | |
33 | @echo installing ${FILES} | |
34 | @-for i in ${FILES}; do \ | |
35 | cmp -s $$i ${DESTDIR}/usr/include/$$i || \ | |
36 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ | |
37 | ${DESTDIR}/usr/include/$$i; \ | |
38 | done | |
39 | @echo installing ${DIRS} | |
40 | @-for i in ${DIRS}; do \ | |
41 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ | |
42 | then \ | |
43 | mkdir ${DESTDIR}/usr/include/$$i; \ | |
44 | fi; \ | |
45 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
46 | chmod 755 ${DESTDIR}/usr/include/$$i; \ | |
47 | (cd $$i; for j in *.[ih]; do \ | |
48 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ | |
49 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \ | |
50 | ${DESTDIR}/usr/include/$$i/$$j; \ | |
51 | done); \ | |
52 | done | |
53 | @echo installing ${LFILES} | |
54 | @-for i in ${LFILES}; do \ | |
55 | rm -f ${DESTDIR}/usr/include/$$i; \ | |
56 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
57 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
58 | done | |
59 | @echo installing ${MFILES} | |
60 | @-for i in ${MFILES}; do \ | |
61 | rm -f ${DESTDIR}/usr/include/$$i; \ | |
62 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ | |
63 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
64 | done | |
65 | ||
66 | copies: | |
67 | @echo copies: ${LDIRS} | |
68 | @-for i in ${LDIRS}; do \ | |
69 | rm -rf ${DESTDIR}/usr/include/$$i; \ | |
70 | cd /sys; \ | |
71 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
17ea84d8 RG |
72 | chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ |
73 | chmod -R 444 ${DESTDIR}/usr/include/$$i; \ | |
74 | chmod 755 ${DESTDIR}/usr/include/$$i; \ | |
15637ed4 | 75 | done |
dfb74133 | 76 | rm -rf ${DESTDIR}/usr/include/machine |
15637ed4 RG |
77 | mkdir ${DESTDIR}/usr/include/machine |
78 | cd /sys/${MACHINE}/include; \ | |
17ea84d8 RG |
79 | tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); |
80 | chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine; | |
81 | chmod -R 444 ${DESTDIR}/usr/include/machine; | |
82 | chmod 755 ${DESTDIR}/usr/include/machine; | |
15637ed4 RG |
83 | |
84 | symlinks: | |
85 | @echo symlinks: ${LDIRS} | |
86 | @for i in ${LDIRS}; do \ | |
87 | rm -rf ${DESTDIR}/usr/include/$$i; \ | |
88 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
89 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \ | |
90 | done | |
12d36c59 | 91 | rm -rf ${DESTDIR}/usr/include/machine |
15637ed4 RG |
92 | ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine |
93 | chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine | |
94 | ||
95 | .include <bsd.prog.mk> |