]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/Makefile
This commit was generated by cvs2svn to compensate for changes in r3904,
[FreeBSD/FreeBSD.git] / include / Makefile
1 #       From: @(#)Makefile      8.2 (Berkeley) 1/4/94
2 #       $Id: Makefile,v 1.15 1994/09/29 21:29:22 pst Exp $
3 #
4 # Doing a make install builds /usr/include
5 #
6 # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
7 # links.
8 #
9 all clean cleandir depend lint tags:
10
11 SUBDIR= rpcsvc
12 # XXX MISSING:  mp.h
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 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 \
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 \
20         utmp.h vis.h
21 .if !defined(WANT_MSUN)
22 FILES+= math.h
23 .endif
24
25 MFILES= float.h floatingpoint.h stdarg.h varargs.h
26 LFILES= errno.h fcntl.h syslog.h termios.h
27
28 DIRS=   arpa protocols rpc
29 LDIRS=  net netccitt netinet netiso netns nfs sys vm
30 LUDIR=  ufs
31 UDIRS=  ufs/ffs ufs/lfs ufs/mfs ufs/ufs
32
33 NOOBJ=  noobj
34
35 # Define SHARED to indicate whether you want symbolic links to the system
36 # source (``symlinks''), or a separate copy (``copies''); (latter useful
37 # in environments where it's not possible to keep /sys publicly readable)
38 # SHARED=       copies
39 SHARED?=        symlinks
40
41 OSREL   = ${DESTDIR}/usr/include/osreldate.h
42 beforeinstall: ${SHARED}
43         @${ECHO} installing ${FILES}
44         @-for i in ${FILES}; do \
45                 cmp -s $$i ${DESTDIR}/usr/include/$$i > /dev/null 2>&1 || \
46                     install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
47                     ${DESTDIR}/usr/include/$$i; \
48         done
49         @${ECHO} creating osreldate.h
50         @echo \#'undef __FreeBSD_version' > ${OSREL}.new
51         @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
52                 >> ${OSREL}.new
53         @if cmp -s ${OSREL} ${OSREL}.new >/dev/null 2>&1 ; then \
54                 rm -f ${OSREL}.new ; else \
55                 mv -f ${OSREL}.new ${OSREL} ; fi
56         @chown ${BINOWN}.${BINGRP} ${OSREL}
57         @chmod 444 ${OSREL}
58         @${ECHO} installing ${DIRS}
59         @-for i in ${DIRS}; do \
60                 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
61                 then \
62                         mkdir ${DESTDIR}/usr/include/$$i; \
63                 fi; \
64                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
65                 chmod 755 ${DESTDIR}/usr/include/$$i; \
66                 (cd $$i; for j in *.[ih]; do \
67                         cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j > \
68                             /dev/null 2>&1 || \
69                             install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
70                             ${DESTDIR}/usr/include/$$i/$$j; \
71                 done); \
72         done
73         @${ECHO} installing ${LFILES}
74         @-for i in ${LFILES}; do \
75                 rm -f ${DESTDIR}/usr/include/$$i; \
76                 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
77                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
78         done
79         @${ECHO} installing ${MFILES}
80         @-for i in ${MFILES}; do \
81                 rm -f ${DESTDIR}/usr/include/$$i; \
82                 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
83                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
84         done
85
86 copies:
87         rm -rf ${DESTDIR}/usr/include/${LUDIR}
88         @-for i in ${LDIRS} ${UDIRS}; do                                \
89                 ${ECHO} ${SHARED} $$i;                                  \
90                 rm -rf ${DESTDIR}/usr/include/$$i;                      \
91                 cd ../sys;                                              \
92                 tar cf - $$i/*.h |                                      \
93                         (cd ${DESTDIR}/usr/include; tar xpfB -);        \
94                 chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;\
95                 chmod -R 444 ${DESTDIR}/usr/include/$$i;                \
96                 chmod 755 ${DESTDIR}/usr/include/$$i;                   \
97         done
98         rm -rf ${DESTDIR}/usr/include/machine
99         mkdir ${DESTDIR}/usr/include/machine
100         cd ../sys/${MACHINE}/include && \
101             tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
102         chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine;
103         chmod -R 444 ${DESTDIR}/usr/include/machine;
104         chmod 755 ${DESTDIR}/usr/include/machine;
105
106 symlinks:
107         @for i in ${LDIRS} ${LUDIR}; do                                 \
108                 ${ECHO} ${SHARED} $$i;                                  \
109                 rm -rf ${DESTDIR}/usr/include/$$i;                      \
110                 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i;              \
111                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;   \
112         done
113         rm -rf ${DESTDIR}/usr/include/machine
114         ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
115
116 .include <bsd.prog.mk>