cleanup
[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#
041e1c01 6# @(#)Makefile 5.10 (Berkeley) 86/01/10
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
8054d0bc 21STD= a.out.h ar.h assert.h ctype.h curses.h ndbm.h disktab.h \
21cad4d8
RE
22 fcntl.h fstab.h grp.h lastlog.h math.h memory.h mp.h mtab.h \
23 netdb.h nlist.h pcc.h ptrace.h pwd.h ranlib.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 26LINKS= errno.h signal.h syslog.h
f067c19e
BJ
27MACHINE=vax
28MACHDEP=${MACHINE} vaxif vaxmba vaxuba
86e71226 29NETDIRS=net netimp netinet netns
f067c19e
BJ
30SYSDIRS=${NETDIRS} stand ${MACHDEP}
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
51 -for i in ${LINKS}; do \
52 rm -f ${DESTDIR}/usr/include/$$i; \
53 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
54 done
55 rm -f ${DESTDIR}/usr/include/machine
56 ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine
57 rm -f ${DESTDIR}/usr/include/frame.h
58 ln -s machine/frame.h ${DESTDIR}/usr/include/frame.h
59
60symlinks:
61 for i in ${SYSDIRS}; do \
62 rm -rf ${DESTDIR}/usr/include/$$i; \
63 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
64 done
65 rm -rf ${DESTDIR}/usr/include/sys
66 ln -s /sys/h ${DESTDIR}/usr/include/sys
67
68copies:
041e1c01 69 -for i in ${SYSDIRS}; do \
f067c19e
BJ
70 rm -rf ${DESTDIR}/usr/include/$$i; \
71 cd /sys; \
68362257 72 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
f067c19e
BJ
73 done
74 rm -rf ${DESTDIR}/usr/include/sys;
75 mkdir ${DESTDIR}/usr/include/sys;
b5b1ef6a 76 chmod 775 ${DESTDIR}/usr/include/sys;
041e1c01 77 -(cd /sys/h; tar cf - *.h | (cd ${DESTDIR}/usr/include/sys; tar xpfB -))
f067c19e 78
87e481ed
SL
79tags:
80 cwd=/usr/include; \
81 for i in ${STD} ${LINKS}; do \
82 ctags -a -f ${TAGSFILE} $$cwd/$$i; \
83 done
84
f067c19e 85clean:
87e481ed 86 rm -f tags