1 # From: @(#)Makefile 8.2 (Berkeley) 1/4/94
2 # $Id: Makefile,v 1.9 1994/08/10 06:24:42 wollman Exp $
4 # Doing a make install builds /usr/include
6 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
9 all clean cleandir depend lint tags:
13 FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
14 err.h fnmatch.h fstab.h fts.h glob.h grp.h histedit.h kvm.h \
15 limits.h link.h locale.h math.h memory.h mpool.h ndbm.h \
16 netdb.h nlist.h paths.h pwd.h ranlib.h regex.h regexp.h \
17 resolv.h rune.h runetype.h setjmp.h sgtty.h signal.h skey.h \
18 stab.h stddef.h stdio.h stdlib.h string.h strings.h struct.h \
19 sysexits.h tar.h time.h ttyent.h tzfile.h unistd.h utime.h \
22 MFILES= float.h floatingpoint.h frame.h stdarg.h varargs.h
23 LFILES= errno.h fcntl.h syslog.h termios.h
25 DIRS= arpa protocols rpc
26 LDIRS= net netccitt netinet netiso netns nfs sys vm
28 UDIRS= ufs/ffs ufs/lfs ufs/mfs ufs/ufs
32 # Define SHARED to indicate whether you want symbolic links to the system
33 # source (``symlinks''), or a separate copy (``copies''); (latter useful
34 # in environments where it's not possible to keep /sys publicly readable)
38 beforeinstall: ${SHARED}
39 @echo installing ${FILES}
40 @-for i in ${FILES}; do \
41 cmp -s $$i ${DESTDIR}/usr/include/$$i > /dev/null 2>&1 || \
42 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
43 ${DESTDIR}/usr/include/$$i; \
45 @echo creating osreldate.h
46 @rm -f ${DESTDIR}/usr/include/osreldate.h
47 @echo \#'undef __FreeBSD_version' > ${DESTDIR}/usr/include/osreldate.h
48 @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
49 >> ${DESTDIR}/usr/include/osreldate.h
50 @echo installing ${DIRS}
51 @-for i in ${DIRS}; do \
52 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
54 mkdir ${DESTDIR}/usr/include/$$i; \
56 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
57 chmod 755 ${DESTDIR}/usr/include/$$i; \
58 (cd $$i; for j in *.[ih]; do \
59 cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j > \
61 install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
62 ${DESTDIR}/usr/include/$$i/$$j; \
65 @echo installing ${LFILES}
66 @-for i in ${LFILES}; do \
67 rm -f ${DESTDIR}/usr/include/$$i; \
68 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
69 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
71 @echo installing ${MFILES}
72 @-for i in ${MFILES}; do \
73 rm -f ${DESTDIR}/usr/include/$$i; \
74 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
75 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
79 rm -rf ${DESTDIR}/usr/include/${LUDIR}
80 @-for i in ${LDIRS} ${UDIRS}; do \
82 rm -rf ${DESTDIR}/usr/include/$$i; \
85 (cd ${DESTDIR}/usr/include; tar xpfB -); \
86 chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;\
87 chmod -R 444 ${DESTDIR}/usr/include/$$i; \
88 chmod 755 ${DESTDIR}/usr/include/$$i; \
90 rm -rf ${DESTDIR}/usr/include/machine
91 mkdir ${DESTDIR}/usr/include/machine
92 cd ../sys/${MACHINE}/include && \
93 tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
94 chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine;
95 chmod -R 444 ${DESTDIR}/usr/include/machine;
96 chmod 755 ${DESTDIR}/usr/include/machine;
99 @for i in ${LDIRS} ${LUDIR}; do \
100 echo ${SHARED} $$i; \
101 rm -rf ${DESTDIR}/usr/include/$$i; \
102 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
103 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
105 rm -rf ${DESTDIR}/usr/include/machine
106 ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
108 .include <bsd.prog.mk>