]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - include/Makefile
MFC r362623:
[FreeBSD/stable/8.git] / include / Makefile
1 #       @(#)Makefile    8.2 (Berkeley) 1/4/94
2 # $FreeBSD$
3 #
4 # Doing a "make install" builds /usr/include.
5
6 .include <bsd.own.mk>
7
8 CLEANFILES= osreldate.h version vers.c
9 SUBDIR= arpa gssapi protocols rpcsvc rpc
10 INCS=   a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
11         db.h \
12         dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
13         fts.h ftw.h getopt.h glob.h grp.h gssapi.h \
14         ieeefp.h ifaddrs.h \
15         inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
16         locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
17         ndbm.h netconfig.h \
18         netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \
19         printf.h proc_service.h pthread.h \
20         pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \
21         res_update.h resolv.h runetype.h search.h setjmp.h \
22         signal.h spawn.h stab.h \
23         stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \
24         strings.h sysexits.h tar.h tgmath.h \
25         time.h timeconv.h timers.h ttyent.h \
26         ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
27         wctype.h wordexp.h
28
29 MHDRS=  float.h floatingpoint.h stdarg.h
30
31 PHDRS=  sched.h semaphore.h _semaphore.h
32
33 LHDRS=  aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \
34         termios.h ucontext.h
35
36 LDIRS=  bsm cam geom net net80211 netatalk netgraph netinet netinet6 \
37         netipsec ${_netipx} netnatm ${_netncp} netsmb \
38         nfs nfsclient nfsserver \
39         sys vm
40
41 LSUBDIRS=       cam/ata cam/scsi \
42         dev/acpica dev/agp dev/an dev/bktr dev/ciss \
43         dev/filemon dev/firewire dev/hwpmc \
44         dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
45         dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
46         dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
47         fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \
48         ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
49         geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
50         geom/mirror geom/multipath geom/nop \
51         geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
52         netgraph/atm netgraph/netflow \
53         security/audit \
54         security/mac_biba security/mac_bsdextended security/mac_lomac \
55         security/mac_mls security/mac_partition \
56         ufs/ffs ufs/ufs
57
58 LSUBSUBDIRS=    dev/mpt/mpilib
59
60 .if ${MACHINE_ARCH} == "powerpc"
61 _dev_powermac_nvram=    dev/powermac_nvram
62 .endif
63
64 .if ${MK_GPIB} != "no"
65 _dev_ieee488=   dev/ieee488
66 .endif
67
68 .if ${MK_HESIOD} != "no"
69 INCS+=  hesiod.h
70 .endif
71
72 .if ${MK_BLUETOOTH} != "no"
73 LSUBSUBDIRS+=   netgraph/bluetooth/include
74 .endif
75
76 # XXX unconditionally needed by <netsmb/netbios.h>
77 #.if ${MK_IPX} != "no"
78 _netipx=        netipx
79 #.endif
80
81 .if ${MK_NCP} != "no"
82 _netncp=        netncp
83 _fs_nwfs=       fs/nwfs
84 .endif
85
86 # Define SHARED to indicate whether you want symbolic links to the system
87 # source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
88 # probably only useful for developers and should be avoided if you do not
89 # wish to tie your /usr/include and /usr/src together.
90 #SHARED=        symlinks
91 SHARED?=        copies
92
93 INCS+=  osreldate.h
94
95 osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \
96     ${.CURDIR}/Makefile
97         @${ECHO} creating osreldate.h from newvers.sh
98         @MAKE=${MAKE}; \
99         PARAMFILE=${.CURDIR}/../sys/sys/param.h; \
100         . ${.CURDIR}/../sys/conf/newvers.sh; \
101         echo "$$COPYRIGHT" > osreldate.h; \
102         echo "#ifdef _KERNEL" >> osreldate.h; \
103         echo "#error \"<osreldate.h> cannot be used in the kernel, use <sys/param.h>\"" >> osreldate.h; \
104         echo "#else" >> osreldate.h; \
105         echo "#undef __FreeBSD_version" >> osreldate.h; \
106         echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \
107         echo "#endif" >> osreldate.h
108
109 .for i in ${LHDRS}
110 INCSLINKS+=     sys/$i ${INCLUDEDIR}/$i
111 .endfor
112 .for i in ${MHDRS}
113 INCSLINKS+=     machine/$i ${INCLUDEDIR}/$i
114 .endfor
115 .for i in ${PHDRS}
116 INCSLINKS+=     sys/$i ${INCLUDEDIR}/$i
117 .endfor
118
119 .if ${MACHINE} != ${MACHINE_ARCH}
120 _MARCH=${MACHINE_ARCH}
121 .endif
122
123 .include <bsd.prog.mk>
124
125 installincludes: ${SHARED}
126 ${SHARED}: compat
127
128 # Take care of stale directory-level symlinks.
129 compat:
130 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto
131         if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
132                 rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
133         fi
134 .endfor
135         mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
136             -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
137             -p ${DESTDIR}${INCLUDEDIR}
138 .if ${MK_BIND_LIBS} != "no"
139         mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
140             -f ${.CURDIR}/../etc/mtree/BIND.include.dist \
141             -p ${DESTDIR}${INCLUDEDIR}
142 .endif
143
144 copies:
145 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \
146         ${_MARCH}
147 .if exists(${DESTDIR}${INCLUDEDIR}/$i)
148         cd ${DESTDIR}${INCLUDEDIR}/$i; \
149         for h in *.h; do \
150                 if [ -L $$h ]; then rm -f $$h; fi; \
151         done
152 .endif
153 .endfor
154 .for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${LSUBSUBDIRS}
155         cd ${.CURDIR}/../sys; \
156         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
157             ${DESTDIR}${INCLUDEDIR}/$i
158 .endfor
159         cd ${.CURDIR}/../sys/dev/acpica; \
160         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
161             ${DESTDIR}${INCLUDEDIR}/dev/acpica
162         cd ${.CURDIR}/../sys/dev/agp; \
163         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
164             ${DESTDIR}${INCLUDEDIR}/dev/agp
165         cd ${.CURDIR}/../sys/dev/bktr; \
166         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
167             ${DESTDIR}${INCLUDEDIR}/dev/bktr
168         cd ${.CURDIR}/../sys/dev/pci; \
169         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
170             ${DESTDIR}${INCLUDEDIR}/dev/pci
171         cd ${.CURDIR}/../sys/contrib/altq/altq; \
172         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
173             ${DESTDIR}${INCLUDEDIR}/altq
174         cd ${.CURDIR}/../sys/fs/cd9660/; \
175         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
176             ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
177 .if ${MK_IPFILTER} != "no"
178         cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
179         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
180             ${DESTDIR}${INCLUDEDIR}/netinet
181 .endif
182         cd ${.CURDIR}/../sys/contrib/pf/net; \
183         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
184             ${DESTDIR}${INCLUDEDIR}/net
185         cd ${.CURDIR}/../sys/crypto; \
186         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
187             ${DESTDIR}${INCLUDEDIR}/crypto
188         cd ${.CURDIR}/../sys/opencrypto; \
189         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
190             ${DESTDIR}${INCLUDEDIR}/crypto
191         cd ${.CURDIR}/../sys/${MACHINE}/include; \
192         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
193             ${DESTDIR}${INCLUDEDIR}/machine
194 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
195         cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
196         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
197             ${DESTDIR}${INCLUDEDIR}/machine/pc
198 .endif
199 .if defined(_MARCH)
200         ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
201             ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
202         cd ${.CURDIR}/../sys/${_MARCH}/include; \
203         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
204             ${DESTDIR}${INCLUDEDIR}/${_MARCH}
205 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
206         ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
207             ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
208         cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
209         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
210             ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
211 .endif
212 .endif
213         cd ${.CURDIR}/../sys/rpc; \
214         ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
215             ${DESTDIR}${INCLUDEDIR}/rpc
216
217 symlinks:
218         @${ECHO} "Setting up symlinks to kernel source tree..."
219 .for i in ${LDIRS}
220         cd ${.CURDIR}/../sys/$i; \
221         for h in *.h; do \
222                 ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
223         done
224 .endfor
225 .for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci}
226         cd ${.CURDIR}/../sys/$i; \
227         for h in *.h; do \
228                 ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
229         done
230 .endfor
231         cd ${.CURDIR}/../sys/dev/acpica; \
232         for h in acpiio.h; do \
233                 ln -fs ../../../../sys/dev/acpica/$$h \
234                     ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
235         done
236         cd ${.CURDIR}/../sys/dev/agp; \
237         for h in agpreg.h; do \
238                 ln -fs ../../../../sys/dev/agp/$$h \
239                     ${DESTDIR}${INCLUDEDIR}/dev/agp; \
240         done
241         cd ${.CURDIR}/../sys/dev/bktr; \
242         for h in ioctl_*.h; do \
243                 ln -fs ../../../../sys/dev/bktr/$$h \
244                     ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
245         done
246         cd ${.CURDIR}/../sys/dev/pci; \
247         for h in pcireg.h; do \
248                 ln -fs ../../../../sys/dev/pci/$$h \
249                     ${DESTDIR}${INCLUDEDIR}/dev/pci; \
250         done
251 .for i in ${LSUBSUBDIRS}
252         cd ${.CURDIR}/../sys/$i; \
253         for h in *.h; do \
254                 ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
255         done
256 .endfor
257         cd ${.CURDIR}/../sys/contrib/altq/altq; \
258         for h in *.h; do \
259                 ln -fs ../../../sys/contrib/altq/altq/$$h \
260                     ${DESTDIR}${INCLUDEDIR}/altq; \
261         done
262 .if ${MK_IPFILTER} != "no"
263         cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
264         for h in *.h; do \
265                 ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
266                     ${DESTDIR}${INCLUDEDIR}/netinet; \
267         done
268 .endif
269         cd ${.CURDIR}/../sys/contrib/pf/net; \
270         for h in *.h; do \
271                 ln -fs ../../../sys/contrib/pf/net/$$h \
272                     ${DESTDIR}${INCLUDEDIR}/net; \
273         done
274         cd ${.CURDIR}/../sys/crypto; \
275         for h in rijndael/rijndael.h; do \
276                 ln -fs ../../../sys/crypto/$$h \
277                     ${DESTDIR}${INCLUDEDIR}/crypto; \
278         done
279         cd ${.CURDIR}/../sys/opencrypto; \
280         for h in *.h; do \
281                 ln -fs ../../../sys/opencrypto/$$h \
282                     ${DESTDIR}${INCLUDEDIR}/crypto; \
283         done
284         cd ${.CURDIR}/../sys/${MACHINE}/include; \
285         for h in *.h; do \
286                 ln -fs ../../../sys/${MACHINE}/include/$$h \
287                     ${DESTDIR}${INCLUDEDIR}/machine; \
288         done
289 .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
290         cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
291         for h in *.h; do \
292                 ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
293                     ${DESTDIR}${INCLUDEDIR}/machine/pc; \
294         done
295 .endif
296 .if defined(_MARCH)
297         ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
298             ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
299         cd ${.CURDIR}/../sys/${_MARCH}/include; \
300         for h in *.h; do \
301                 ln -fs ../../../sys/${_MARCH}/include/$$h \
302                     ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
303         done
304 .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
305         ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
306             ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
307         cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
308         for h in *.h; do \
309                 ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
310                     ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
311         done
312 .endif
313 .endif
314         cd ${.CURDIR}/../sys/fs/cd9660; \
315         for h in *.h; do \
316                 ln -fs ../../../../sys/fs/cd9660/$$h \
317                     ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
318         done
319         cd ${.CURDIR}/../sys/rpc; \
320         for h in types.h; do \
321                 ln -fs ../../../sys/rpc/$$h \
322                     ${DESTDIR}${INCLUDEDIR}/rpc; \
323         done