]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/Makefile
This commit was generated by cvs2svn to compensate for changes in r2986,
[FreeBSD/FreeBSD.git] / include / Makefile
1 #       From: @(#)Makefile      8.2 (Berkeley) 1/4/94
2 #       $Id: Makefile,v 1.12 1994/09/08 10:36:30 bde 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 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 \
20         utmp.h vis.h
21 .if !defined(WANT_MSUN)
22 FILES+= math.h
23 .endif
24
25 MFILES= float.h floatingpoint.h frame.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 beforeinstall: ${SHARED}
42         @${ECHO} installing ${FILES}
43         @-for i in ${FILES}; do \
44                 cmp -s $$i ${DESTDIR}/usr/include/$$i > /dev/null 2>&1 || \
45                     install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \
46                     ${DESTDIR}/usr/include/$$i; \
47         done
48         @${ECHO} creating osreldate.h
49         @rm -f ${DESTDIR}/usr/include/osreldate.h
50         @echo \#'undef __FreeBSD_version' > ${DESTDIR}/usr/include/osreldate.h
51         @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \
52                 >> ${DESTDIR}/usr/include/osreldate.h
53         @chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/osreldate.h
54         @chmod 444 ${DESTDIR}/usr/include/osreldate.h
55         @${ECHO} installing ${DIRS}
56         @-for i in ${DIRS}; do \
57                 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
58                 then \
59                         mkdir ${DESTDIR}/usr/include/$$i; \
60                 fi; \
61                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
62                 chmod 755 ${DESTDIR}/usr/include/$$i; \
63                 (cd $$i; for j in *.[ih]; do \
64                         cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j > \
65                             /dev/null 2>&1 || \
66                             install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
67                             ${DESTDIR}/usr/include/$$i/$$j; \
68                 done); \
69         done
70         @${ECHO} installing ${LFILES}
71         @-for i in ${LFILES}; do \
72                 rm -f ${DESTDIR}/usr/include/$$i; \
73                 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
74                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
75         done
76         @${ECHO} installing ${MFILES}
77         @-for i in ${MFILES}; do \
78                 rm -f ${DESTDIR}/usr/include/$$i; \
79                 ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
80                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
81         done
82
83 copies:
84         rm -rf ${DESTDIR}/usr/include/${LUDIR}
85         @-for i in ${LDIRS} ${UDIRS}; do                                \
86                 ${ECHO} ${SHARED} $$i;                                  \
87                 rm -rf ${DESTDIR}/usr/include/$$i;                      \
88                 cd ../sys;                                              \
89                 tar cf - $$i/*.h |                                      \
90                         (cd ${DESTDIR}/usr/include; tar xpfB -);        \
91                 chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;\
92                 chmod -R 444 ${DESTDIR}/usr/include/$$i;                \
93                 chmod 755 ${DESTDIR}/usr/include/$$i;                   \
94         done
95         rm -rf ${DESTDIR}/usr/include/machine
96         mkdir ${DESTDIR}/usr/include/machine
97         cd ../sys/${MACHINE}/include && \
98             tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
99         chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine;
100         chmod -R 444 ${DESTDIR}/usr/include/machine;
101         chmod 755 ${DESTDIR}/usr/include/machine;
102
103 symlinks:
104         @for i in ${LDIRS} ${LUDIR}; do                                 \
105                 ${ECHO} ${SHARED} $$i;                                  \
106                 rm -rf ${DESTDIR}/usr/include/$$i;                      \
107                 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i;              \
108                 chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i;   \
109         done
110         rm -rf ${DESTDIR}/usr/include/machine
111         ln -s /sys/${MACHINE}/include ${DESTDIR}/usr/include/machine
112
113 .include <bsd.prog.mk>