Commit | Line | Data |
---|---|---|
4e2935bc | 1 | # @(#)Makefile.install 5.7 (Berkeley) %G% |
c73cc458 | 2 | # |
04f86cad | 3 | # Makefile for /usr/include, used to convert system include subdirectories |
4e2935bc KB |
4 | # between symbolic links and copies of kernel headers. May also be used to |
5 | # update copies from kernel header files. | |
c73cc458 | 6 | # |
4e2935bc KB |
7 | # The ``rm -rf''s used below are safe because rm doesn't follow symbolic |
8 | # links. | |
c73cc458 | 9 | # |
4e2935bc | 10 | |
c73cc458 | 11 | SYS=/sys |
4e2935bc KB |
12 | DIRS= sys net netimp netinet netns ${MACHINE} |
13 | .if (${MACHINE} == "tahoe") | |
14 | DIRS+= tahoeif tahoevba | |
15 | .elif (${MACHINE} == "vax") | |
16 | DIRS+= vaxif vaxmba vaxuba | |
17 | .endif | |
c73cc458 MK |
18 | |
19 | all: | |
20 | @echo "\"make symlinks\", \"make copies\", or \"make update\" only" | |
21 | @false | |
22 | ||
4e2935bc | 23 | copies: |
d14cc0b5 | 24 | rm -rf machine |
1f7d65ee | 25 | ln -s ${MACHINE} machine |
4e2935bc | 26 | -for i in ${DIRS}; do \ |
1f7d65ee MK |
27 | rm -rf $$i; \ |
28 | (cd ${SYS}; tar cf - $$i/*.h) | tar xpfB -; \ | |
29 | done | |
c73cc458 | 30 | |
4e2935bc KB |
31 | symlinks: |
32 | rm -rf machine | |
33 | ln -s ${MACHINE} machine | |
34 | for i in ${DIRS}; do \ | |
1f7d65ee | 35 | rm -rf $$i; \ |
4e2935bc | 36 | ln -s ${SYS}/$$i $$i; \ |
1f7d65ee MK |
37 | done |
38 | ||
4e2935bc KB |
39 | update: |
40 | rm -rf machine | |
1f7d65ee | 41 | ln -s ${MACHINE} machine |
4e2935bc | 42 | -for i in ${DIRS}; do \ |
1f7d65ee MK |
43 | if [ ! -d $$i ]; \ |
44 | then \ | |
45 | mkdir $$i; \ | |
46 | fi; \ | |
47 | for j in `cd ${SYS}/$$i; echo *.[ih]`; do \ | |
48 | cmp -s ${SYS}/$$i/$$j $$i/$$j || \ | |
4e2935bc KB |
49 | install -c -o ${BINOWN} -g ${BINGRP} -m 444 \ |
50 | ${SYS}/$$i/$$j $$i/$$j; \ | |
1f7d65ee MK |
51 | done; \ |
52 | done | |
53 | ||
4e2935bc | 54 | clean cleandir depend lint tags: |