Commit | Line | Data |
---|---|---|
bb0cfa24 | 1 | # |
e09978bd KB |
2 | # Copyright (c) 1988 The Regents of the University of California. |
3 | # All rights reserved. | |
bb0cfa24 | 4 | # |
e09978bd KB |
5 | # Redistribution and use in source and binary forms are permitted |
6 | # provided that the above copyright notice and this paragraph are | |
7 | # duplicated in all such forms and that any documentation, | |
8 | # advertising materials, and other materials related to such | |
9 | # distribution and use acknowledge that the software was developed | |
10 | # by the University of California, Berkeley. The name of the | |
11 | # University may not be used to endorse or promote products derived | |
12 | # from this software without specific prior written permission. | |
13 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
16 | # | |
9b051870 | 17 | # @(#)Makefile 5.28 (Berkeley) %G% |
f067c19e BJ |
18 | # |
19 | # Doing a make install builds /usr/include | |
20 | # | |
e09978bd KB |
21 | # Define SHARED to indicate whether you want symbolic links to the |
22 | # system source (``symlinks''), or a separate copy (``copies''); | |
23 | # (latter useful in environments where it's not possible to keep | |
24 | # /sys publicly readable) | |
f067c19e | 25 | # |
e09978bd KB |
26 | # The ``rm -rf''s used below are safe because rm doesn't follow |
27 | # symbolic links. | |
f067c19e BJ |
28 | # |
29 | DESTDIR= | |
9b051870 | 30 | SUBDIRS=arpa pascal protocols |
c4d74ccf | 31 | STD= a.out.h ar.h assert.h ctype.h curses.h ndbm.h dirent.h disktab.h \ |
c20c0f11 | 32 | fcntl.h fstab.h ftw.h grp.h limits.h math.h memory.h mp.h \ |
e09978bd KB |
33 | netdb.h nlist.h paths.h pcc.h pwd.h ranlib.h regexp.h resolv.h \ |
34 | setjmp.h sgtty.h stab.h stdarg.h stdio.h string.h strings.h \ | |
35 | struct.h sysexits.h time.h ttyent.h tzfile.h unistd.h utmp.h \ | |
36 | varargs.h vfont.h | |
c20c0f11 KB |
37 | SYSLINKS= errno.h signal.h syslog.h termios.h |
38 | MCHLINKS= float.h frame.h | |
5a9c27d0 | 39 | |
9419d40a | 40 | SYSDIRS= sys net netimp netinet netns ufs nfs |
5a9c27d0 KB |
41 | TAHOEDIRS= tahoe tahoemath tahoevba tahoeif |
42 | VAXDIRS= vax vaxmba vaxuba vaxif | |
f067c19e | 43 | SHARED= symlinks |
87e481ed | 44 | TAGSFILE=tags |
f067c19e BJ |
45 | |
46 | all: | |
47 | ||
48 | install: ${SHARED} | |
49 | -for i in ${STD}; do \ | |
37c41805 RE |
50 | cmp -s $$i ${DESTDIR}/usr/include/$$i || \ |
51 | install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \ | |
f067c19e BJ |
52 | done |
53 | -for i in ${SUBDIRS}; do \ | |
54 | if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ | |
55 | then \ | |
56 | mkdir ${DESTDIR}/usr/include/$$i; \ | |
57 | fi; \ | |
f62b324d | 58 | (cd $$i; for j in *.[ih]; do \ |
37c41805 | 59 | cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \ |
b5b1ef6a | 60 | install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \ |
f067c19e BJ |
61 | done); \ |
62 | done | |
03cf05f8 | 63 | -cmp -s Makefile.install ${DESTDIR}/usr/include/Makefile || \ |
eb7574ea | 64 | install -c -m 444 Makefile.install ${DESTDIR}/usr/include/Makefile |
c20c0f11 KB |
65 | rm -f ${DESTDIR}/usr/include/machine |
66 | ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine | |
67 | -for i in ${SYSLINKS}; do \ | |
f067c19e BJ |
68 | rm -f ${DESTDIR}/usr/include/$$i; \ |
69 | ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
70 | done | |
c20c0f11 KB |
71 | -for i in ${MCHLINKS}; do \ |
72 | rm -f ${DESTDIR}/usr/include/$$i; \ | |
73 | ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \ | |
74 | done | |
f067c19e | 75 | |
5a9c27d0 | 76 | symlinks: ${MACHINE}.symlinks |
5a9c27d0 KB |
77 | |
78 | tahoe.symlinks: | |
f067c19e | 79 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
eb7574ea MK |
80 | if [ ! -s ${DESTDIR}/usr/include/$$i ]; \ |
81 | then \ | |
82 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
83 | else \ | |
84 | echo ${DESTDIR}/usr/include/$$i not removed; \ | |
85 | fi; \ | |
f067c19e | 86 | done |
f067c19e | 87 | |
5a9c27d0 | 88 | vax.symlinks: |
f067c19e | 89 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
5a9c27d0 KB |
90 | if [ ! -s ${DESTDIR}/usr/include/$$i ]; \ |
91 | then \ | |
92 | ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ | |
93 | else \ | |
94 | echo ${DESTDIR}/usr/include/$$i not removed; \ | |
95 | fi; \ | |
f067c19e | 96 | done |
5a9c27d0 KB |
97 | |
98 | copies: ${MACHINE}.copies | |
f067c19e | 99 | |
5a9c27d0 | 100 | tahoe.copies: |
5a9c27d0 KB |
101 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
102 | cd /sys; \ | |
103 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
104 | done | |
105 | ||
106 | vax.copies: | |
2f6c7683 | 107 | -for i in ${SYSDIRS} ${VAXDIRS}; do \ |
5a9c27d0 KB |
108 | rm -rf ${DESTDIR}/usr/include/$$i; \ |
109 | cd /sys; \ | |
110 | tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ | |
111 | done | |
112 | ||
87e481ed SL |
113 | tags: |
114 | cwd=/usr/include; \ | |
115 | for i in ${STD} ${LINKS}; do \ | |
116 | ctags -a -f ${TAGSFILE} $$cwd/$$i; \ | |
117 | done | |
118 | ||
f067c19e | 119 | clean: |
e09978bd KB |
120 | |
121 | cleandir: clean | |
87e481ed | 122 | rm -f tags |
5a9c27d0 KB |
123 | |
124 | depend: |