file reorg, pathnames.h, paths.h
[unix-history] / usr / src / include / Makefile
CommitLineData
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#
2f6c7683 6# @(#)Makefile 5.24 (Berkeley) 89/04/28
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#
19DESTDIR=
86e71226 20SUBDIRS=arpa pascal protocols
c4d74ccf 21STD= a.out.h ar.h assert.h ctype.h curses.h ndbm.h dirent.h disktab.h \
f49bc7d1 22 fcntl.h fstab.h ftw.h grp.h lastlog.h math.h memory.h mp.h mtab.h \
c2e13cef 23 netdb.h nlist.h pcc.h pwd.h ranlib.h regexp.h resolv.h setjmp.h \
642f8667 24 sgtty.h stab.h stdarg.h stdio.h string.h strings.h struct.h \
bfbd38dc 25 sysexits.h time.h ttyent.h tzfile.h utmp.h varargs.h vfont.h
637cfd18 26LINKS= errno.h signal.h syslog.h
5a9c27d0 27
2f6c7683 28SYSDIRS= sys net netimp netinet netns
5a9c27d0
KB
29TAHOEDIRS= tahoe tahoemath tahoevba tahoeif
30VAXDIRS= vax vaxmba vaxuba vaxif
f067c19e 31SHARED= symlinks
87e481ed 32TAGSFILE=tags
f067c19e
BJ
33
34all:
35
36install: ${SHARED}
37 -for i in ${STD}; do \
37c41805
RE
38 cmp -s $$i ${DESTDIR}/usr/include/$$i || \
39 install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \
f067c19e
BJ
40 done
41 -for i in ${SUBDIRS}; do \
42 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
43 then \
44 mkdir ${DESTDIR}/usr/include/$$i; \
45 fi; \
f62b324d 46 (cd $$i; for j in *.[ih]; do \
37c41805 47 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
b5b1ef6a 48 install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
f067c19e
BJ
49 done); \
50 done
03cf05f8 51 -cmp -s Makefile.install ${DESTDIR}/usr/include/Makefile || \
eb7574ea 52 install -c -m 444 Makefile.install ${DESTDIR}/usr/include/Makefile
f067c19e
BJ
53 -for i in ${LINKS}; do \
54 rm -f ${DESTDIR}/usr/include/$$i; \
55 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
56 done
57 rm -f ${DESTDIR}/usr/include/machine
58 ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine
59 rm -f ${DESTDIR}/usr/include/frame.h
60 ln -s machine/frame.h ${DESTDIR}/usr/include/frame.h
61
5a9c27d0 62symlinks: ${MACHINE}.symlinks
5a9c27d0
KB
63
64tahoe.symlinks:
2f6c7683 65 -for i in ${SYSDIRS} ${TAHOEDIRS}; do \
f067c19e 66 rm -rf ${DESTDIR}/usr/include/$$i; \
eb7574ea
MK
67 if [ ! -s ${DESTDIR}/usr/include/$$i ]; \
68 then \
69 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
70 else \
71 echo ${DESTDIR}/usr/include/$$i not removed; \
72 fi; \
f067c19e 73 done
f067c19e 74
5a9c27d0 75vax.symlinks:
2f6c7683 76 -for i in ${SYSDIRS} ${VAXDIRS}; do \
f067c19e 77 rm -rf ${DESTDIR}/usr/include/$$i; \
5a9c27d0
KB
78 if [ ! -s ${DESTDIR}/usr/include/$$i ]; \
79 then \
80 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
81 else \
82 echo ${DESTDIR}/usr/include/$$i not removed; \
83 fi; \
f067c19e 84 done
5a9c27d0
KB
85
86copies: ${MACHINE}.copies
f067c19e 87
5a9c27d0 88tahoe.copies:
2f6c7683 89 -for i in ${SYSDIRS} ${TAHOEDIRS}; do \
5a9c27d0
KB
90 rm -rf ${DESTDIR}/usr/include/$$i; \
91 cd /sys; \
92 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
93 done
94
95vax.copies:
2f6c7683 96 -for i in ${SYSDIRS} ${VAXDIRS}; do \
5a9c27d0
KB
97 rm -rf ${DESTDIR}/usr/include/$$i; \
98 cd /sys; \
99 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
100 done
101
87e481ed
SL
102tags:
103 cwd=/usr/include; \
104 for i in ${STD} ${LINKS}; do \
105 ctags -a -f ${TAGSFILE} $$cwd/$$i; \
106 done
107
f067c19e 108clean:
87e481ed 109 rm -f tags
5a9c27d0
KB
110
111depend: