various bugs fixed, works on local enet
[unix-history] / usr / src / include / Makefile
CommitLineData
ac1f33de 1# @(#)Makefile 5.40 (Berkeley) %G%
f067c19e
BJ
2#
3# Doing a make install builds /usr/include
4#
770d844a
KB
5# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
6# links.
f067c19e 7#
770d844a
KB
8all clean cleandir depend lint tags:
9
ede96f37 10SUBDIRS=arpa protocols
ac1f33de
KB
11STD= a.out.h ar.h assert.h bitstring.h ctype.h dirent.h disktab.h \
12 fstab.h fts.h glob.h grp.h kvm.h limits.h math.h memory.h mp.h \
13 ndbm.h netdb.h nlist.h paths.h pcc.h pwd.h ranlib.h regexp.h \
14 resolv.h setjmp.h sgtty.h stab.h stdarg.h stddef.h stdio.h \
15 stdlib.h string.h strings.h struct.h sysexits.h time.h ttyent.h \
16 tzfile.h utmp.h varargs.h vfont.h vis.h
770d844a 17LMCH= float.h frame.h
645b70bf 18LSYS= errno.h fcntl.h signal.h syslog.h termios.h unistd.h
2716b41c 19NOOBJ= noobj
5a9c27d0 20
770d844a 21DIRS= sys net netimp netinet netiso netns ufs nfs
645b70bf
KB
22.if (${MACHINE} == "hp300")
23DIRS+= hp300 hpdev
24.elif (${MACHINE} == "tahoe")
770d844a
KB
25DIRS+= tahoe tahoemath tahoevba tahoeif
26.elif (${MACHINE} == "vax")
ac1f33de 27DIRS+= vax vaxbi vaxif vaxmba vaxuba
770d844a 28.endif
f067c19e 29
770d844a
KB
30# Define SHARED to indicate whether you want symbolic links to the system
31# source (``symlinks''), or a separate copy (``copies''); (latter useful
32# in environments where it's not possible to keep /sys publicly readable)
33# SHARED= copies
34SHARED= symlinks
f067c19e
BJ
35
36install: ${SHARED}
770d844a
KB
37 @echo installing ${STD}
38 @-for i in ${STD}; do \
c8c70607 39 cmp -s $$i ${DESTDIR}/usr/include/$$i || \
770d844a
KB
40 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
41 ${DESTDIR}/usr/include/$$i; \
f067c19e 42 done
770d844a
KB
43 @echo installing ${SUBDIRS}
44 @-for i in ${SUBDIRS}; do \
f067c19e
BJ
45 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
46 then \
47 mkdir ${DESTDIR}/usr/include/$$i; \
48 fi; \
770d844a
KB
49 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
50 chmod 755 ${DESTDIR}/usr/include/$$i; \
f62b324d 51 (cd $$i; for j in *.[ih]; do \
c8c70607 52 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
770d844a
KB
53 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
54 ${DESTDIR}/usr/include/$$i/$$j; \
f067c19e
BJ
55 done); \
56 done
770d844a
KB
57 install -c -o ${BINOWN} -g ${BINGRP} -m 444 Makefile.install \
58 ${DESTDIR}/usr/include/Makefile
c20c0f11
KB
59 rm -f ${DESTDIR}/usr/include/machine
60 ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine
ac1f33de 61 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine
770d844a
KB
62 @echo installing ${LSYS}
63 @-for i in ${LSYS}; do \
f067c19e
BJ
64 rm -f ${DESTDIR}/usr/include/$$i; \
65 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
599715c8 66 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
f067c19e 67 done
770d844a
KB
68 @echo installing ${LMCH}
69 @-for i in ${LMCH}; do \
c20c0f11
KB
70 rm -f ${DESTDIR}/usr/include/$$i; \
71 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
599715c8 72 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
c20c0f11 73 done
f067c19e 74
ac1f33de
KB
75copies:
76 @echo copies: ${DIRS}
77 @-for i in ${DIRS}; do \
78 rm -rf ${DESTDIR}/usr/include/$$i; \
79 cd /sys; \
80 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
81 done
82
f067c19e 83 rm -rf ${DESTDIR}/usr/include/$$i; \
eb7574ea
MK
84 if [ ! -s ${DESTDIR}/usr/include/$$i ]; \
85 then \
86 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
599715c8 87 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
eb7574ea
MK
88 else \
89 echo ${DESTDIR}/usr/include/$$i not removed; \
90 fi; \
f067c19e 91 done
f067c19e 92
ac1f33de
KB
93 if [ ! -d $$i ]; \
94 then \
95 mkdir $$i; \
96 fi; \
97 for j in `cd /sys/$$i; echo *.h`; do \
98 cmp -s /sys/$$i/$$j $$i/$$j || \
99 install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
100 ${SYS}/$$i/$$j $$i/$$j; \
101 done; \
5a9c27d0
KB
102 done
103
2716b41c 104.include <bsd.prog.mk>