This patch is from sim@cory.berkeley.edu (Peng-Toh Sim). It fixes a bug
[unix-history] / include / Makefile
CommitLineData
15637ed4
RG
1# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
2#
2949bf6a 3# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
15637ed4
RG
4# links.
5#
6all clean cleandir depend lint tags:
7
8# Missing: mp.h
9
10FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
bdd191e5
NW
11 err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
12 math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h \
13 ranlib.h regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h \
14 stddef.h stdio.h stdlib.h string.h strings.h struct.h sysexits.h \
15 time.h ttyent.h tzfile.h unistd.h utime.h utmp.h varargs.h vis.h
15637ed4
RG
16
17MFILES= float.h frame.h
f0f4e3ed 18LFILES= errno.h fcntl.h signal.h syslog.h syscall.h termios.h
15637ed4
RG
19
20DIRS=arpa protocols
9241bfd5
RM
21LDIRS= net netccitt netinet netiso netns nfs sys ufs vm
22# removed netimp depricated?
15637ed4
RG
23
24NOOBJ= noobj
25
26# Define SHARED to indicate whether you want symbolic links to the system
27# source (``symlinks''), or a separate copy (``copies''); (latter useful
28# in environments where it's not possible to keep /sys publicly readable)
29# SHARED= copies
30SHARED= symlinks
31
32install: ${SHARED}
33 @echo installing ${FILES}
34 @-for i in ${FILES}; do \
35 cmp -s $$i ${DESTDIR}/usr/include/$$i || \
36 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
37 ${DESTDIR}/usr/include/$$i; \
38 done
39 @echo installing ${DIRS}
40 @-for i in ${DIRS}; do \
41 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
42 then \
43 mkdir ${DESTDIR}/usr/include/$$i; \
44 fi; \
45 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
46 chmod 755 ${DESTDIR}/usr/include/$$i; \
47 (cd $$i; for j in *.[ih]; do \
48 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
49 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
50 ${DESTDIR}/usr/include/$$i/$$j; \
51 done); \
52 done
53 @echo installing ${LFILES}
54 @-for i in ${LFILES}; do \
55 rm -f ${DESTDIR}/usr/include/$$i; \
56 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
57 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
58 done
59 @echo installing ${MFILES}
60 @-for i in ${MFILES}; do \
61 rm -f ${DESTDIR}/usr/include/$$i; \
62 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
63 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
64 done
65
66copies:
67 @echo copies: ${LDIRS}
68 @-for i in ${LDIRS}; do \
69 rm -rf ${DESTDIR}/usr/include/$$i; \
70 cd /sys; \
71 tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
72 done
dfb74133 73 rm -rf ${DESTDIR}/usr/include/machine
15637ed4
RG
74 mkdir ${DESTDIR}/usr/include/machine
75 cd /sys/${MACHINE}/include; \
76 tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -); \
77
78symlinks:
79 @echo symlinks: ${LDIRS}
80 @for i in ${LDIRS}; do \
81 rm -rf ${DESTDIR}/usr/include/$$i; \
82 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
83 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
84 done
85 rm -f ${DESTDIR}/usr/include/machine
86 ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
87 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine
88
89.include <bsd.prog.mk>