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