Commit | Line | Data |
---|---|---|
bb0cfa24 DF |
1 | # |
2 | # Copyright (c) 1980 Regents of the University of California. | |
3 | # All rights reserved. The Berkeley software License Agreement | |
4 | # specifies the terms and conditions for redistribution. | |
5 | # | |
c8cb1e33 | 6 | # @(#)Makefile 5.15 (Berkeley) 86/10/13 |
f067c19e BJ |
7 | # |
8 | # Doing a make install builds /usr/include | |
9 | # | |
10 | # Define SHARED to indicate whether you want | |
11 | # symbolic links to the system source (``symlinks''), | |
12 | # or a separate copy (``copies''). | |
13 | # (latter useful in environments where it's | |
14 | # not possible to keep /sys publicly readable) | |
15 | # | |
16 | # The ``rm -rf''s used below are safe because rm doesn't | |
17 | # follow symbolic links. | |
18 | # | |
19 | DESTDIR= | |
86e71226 | 20 | SUBDIRS=arpa pascal protocols |
8054d0bc | 21 | STD= a.out.h ar.h assert.h ctype.h curses.h ndbm.h disktab.h \ |
21cad4d8 | 22 | fcntl.h fstab.h grp.h lastlog.h math.h memory.h mp.h mtab.h \ |
2023432e | 23 | netdb.h nlist.h pcc.h pwd.h ranlib.h resolv.h setjmp.h \ |
eb678d52 RE |
24 | sgtty.h stab.h stdio.h string.h strings.h struct.h syscall.h \ |
25 | sysexits.h time.h ttyent.h utmp.h varargs.h vfont.h | |
637cfd18 | 26 | LINKS= errno.h signal.h syslog.h |
c8cb1e33 SL |
27 | #ifdef vax |
28 | #MACHINE=vax | |
29 | #MACHDEP=${MACHINE} vaxif vaxmba vaxuba | |
30 | #endif | |
31 | MACHINE=tahoe | |
32 | MACHDEP=${MACHINE} tahoeif tahoevba tahoemath | |
86e71226 | 33 | NETDIRS=net netimp netinet netns |
f067c19e BJ |
34 | SYSDIRS=${NETDIRS} stand ${MACHDEP} |
35 | SHARED= symlinks | |
87e481ed | 36 | TAGSFILE=tags |
f067c19e BJ |
37 | |
38 | all: | |
39 | ||
40 | install: ${SHARED} | |
41 | -for i in ${STD}; do \ | |
37c41805 RE |
42 | cmp -s $$i ${DESTDIR}/usr/include/$$i || \ |
43 | install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \ | |
f067c19e BJ |
44 | done |
45 | -for i in ${SUBDIRS}; do \ | |
46 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ | |
47 | then \ | |
48 | mkdir ${DESTDIR}/usr/include/$$i; \ | |
49 | fi; \ | |
f62b324d | 50 | (cd $$i; for j in *.[ih]; do \ |
37c41805 | 51 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ |
b5b1ef6a | 52 | install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \ |
f067c19e BJ |
53 | done); \ |
54 | done | |
03cf05f8 | 55 | -cmp -s Makefile.install ${DESTDIR}/usr/include/Makefile || \ |
eb7574ea | 56 | install -c -m 444 Makefile.install ${DESTDIR}/usr/include/Makefile |
f067c19e BJ |
57 | -for i in ${LINKS}; do \ |
58 | rm -f ${DESTDIR}/usr/include/$$i; \ | |
59 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
60 | done | |
61 | rm -f ${DESTDIR}/usr/include/machine | |
62 | ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine | |
63 | rm -f ${DESTDIR}/usr/include/frame.h | |
64 | ln -s machine/frame.h ${DESTDIR}/usr/include/frame.h | |
65 | ||
66 | symlinks: | |
eb7574ea | 67 | -for i in ${SYSDIRS}; do \ |
f067c19e | 68 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
eb7574ea MK |
69 | if [ ! -s ${DESTDIR}/usr/include/$$i ]; \ |
70 | then \ | |
71 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
72 | else \ | |
73 | echo ${DESTDIR}/usr/include/$$i not removed; \ | |
74 | fi; \ | |
f067c19e BJ |
75 | done |
76 | rm -rf ${DESTDIR}/usr/include/sys | |
eb7574ea MK |
77 | -if [ ! -s ${DESTDIR}/usr/include/sys ]; \ |
78 | then \ | |
79 | ln -s /sys/h ${DESTDIR}/usr/include/sys; \ | |
80 | else \ | |
81 | echo ${DESTDIR}/usr/include/sys not removed; \ | |
82 | fi | |
f067c19e BJ |
83 | |
84 | copies: | |
041e1c01 | 85 | -for i in ${SYSDIRS}; do \ |
f067c19e BJ |
86 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
87 | cd /sys; \ | |
68362257 | 88 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ |
f067c19e BJ |
89 | done |
90 | rm -rf ${DESTDIR}/usr/include/sys; | |
91 | mkdir ${DESTDIR}/usr/include/sys; | |
b5b1ef6a | 92 | chmod 775 ${DESTDIR}/usr/include/sys; |
041e1c01 | 93 | -(cd /sys/h; tar cf - *.h | (cd ${DESTDIR}/usr/include/sys; tar xpfB -)) |
f067c19e | 94 | |
87e481ed SL |
95 | tags: |
96 | cwd=/usr/include; \ | |
97 | for i in ${STD} ${LINKS}; do \ | |
98 | ctags -a -f ${TAGSFILE} $$cwd/$$i; \ | |
99 | done | |
100 | ||
f067c19e | 101 | clean: |
87e481ed | 102 | rm -f tags |