Fix spurious spelling within comments.
[dragonfly.git] / include / Makefile
CommitLineData
984263bc
MD
1# @(#)Makefile 8.2 (Berkeley) 1/4/94
2# $FreeBSD: src/include/Makefile,v 1.109.2.27 2003/01/24 05:12:29 sam Exp $
92d3a869 3# $DragonFly: src/include/Makefile,v 1.6 2003/08/09 22:00:54 asmodai Exp $
984263bc
MD
4#
5# Doing a make install builds /usr/include
6#
7# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
8# links.
9
10CLEANFILES= osreldate.h version vers.c
11SUBDIR= arpa protocols rpc rpcsvc
12INCS= a.out.h ar.h assert.h bitstring.h complex.h ctype.h db.h \
13 dirent.h disktab.h \
14 dlfcn.h elf.h elf-hints.h err.h fnmatch.h fstab.h \
15 fts.h glob.h grp.h strhash.h histedit.h ieeefp.h ifaddrs.h iso646.h \
92d3a869 16 langinfo.h libgen.h limits.h link.h locale.h malloc.h memory.h \
8dd7bfa8 17 mpool.h ndbm.h netdb.h nl_types.h nlist.h objformat.h \
984263bc
MD
18 paths.h pthread.h pthread_np.h pwd.h \
19 ranlib.h readpassphrase.h regex.h regexp.h resolv.h rune.h runetype.h \
20 search.h setjmp.h sgtty.h \
21 signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h \
22 string.h stringlist.h strings.h struct.h sysexits.h tar.h time.h \
23 timers.h ttyent.h unistd.h utime.h utmp.h vis.h wchar.h wctype.h
24
25MHDRS= float.h floatingpoint.h stdarg.h varargs.h
26
27# posix4/aio.h conflicts with dysons and isn't installed:
28PHDRS= mqueue.h sched.h semaphore.h # aio.h
29
30# Only for default SHARED=copies case
31SHDRS= soundcard.h joystick.h
32
33LHDRS= aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \
34 termios.h ucontext.h
35
38a690d7
MD
36# directories which also contain header files that need to be coiped.
37# Other directories, like 'bus' and 'netproto', are created using mtree.
38#
39# XXX allow these directories to not contain header files.
435d74a4 40LDIRS= net netgraph netinet netinet6 sys vm
984263bc 41
38a690d7
MD
42# Subdirectories containing header files to copy. In symlink mode
43# the subdirectory will be symlinked. Care must be taken to adjust
44# LSYMSUBDIRS below to remove subdirectories whos parent directories.
45# If you make a mistake, part of your source tree might get overwritten
46# when buildworld is run.
47#
435d74a4
MD
48LSUBDIRS= bus/cam bus/cam/scsi \
49 emulation/posix4 \
38a690d7 50 emulation/linux \
435d74a4 51 vfs/msdosfs vfs/nfs vfs/ntfs vfs/nwfs \
38a690d7
MD
52 vfs/ufs vfs/smbfs \
53 net/vlan net/ipfw net/ip6fw net/dummynet net/sppp net/ip_mroute \
54 net/bridge net/tun net/ppp net/ppp_layer net/sl \
55 netgraph/UI netgraph/async netgraph/bpf netgraph/bridge \
56 netgraph/cisco netgraph/echo netgraph/eiface netgraph/etf \
57 netgraph/ether netgraph/fec netgraph/frame_relay netgraph/hole \
58 netgraph/iface netgraph/ksocket netgraph/l2tp netgraph/lmi \
59 netgraph/mppc netgraph/one2many netgraph/ppp \
60 netgraph/pppoe netgraph/pptpgre netgraph/rfc1490 netgraph/socket \
61 netgraph/tee netgraph/tty netgraph/vjc \
62 bus/cam bus/usb bus/pccard bus/pci bus/isa \
435d74a4
MD
63 netproto/atalk netproto/atm netproto/ipsec netproto/ipx \
64 netproto/key netproto/natm netproto/ncp netproto/ns netproto/smb \
65 netproto/atm/ipatm netproto/atm/sigpvc netproto/atm/spans \
38a690d7 66 netproto/atm/uni
984263bc 67
38a690d7
MD
68LSUBDIRS3= vfs/isofs/cd9660 net/i4b/include \
69 dev/misc/lpt dev/netif/wi
70
71# For SHARED=symlinks, bus/cam and netproto/atm are symlinks, so cam/scsi
72# and netproto/atm/* are taken care of
73LSYMSUBDIRS= ${LSUBDIRS:Nbus/cam/scsi:Nnetproto/atm/*:Nnet/*:Nnetgraph/*}
74LSYMSUBDIRS3= ${LSUBDIRS3:Nnet/*}
984263bc
MD
75
76# Define SHARED to indicate whether you want symbolic links to the system
77# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
78# probably only useful for developers and should be avoided if you do not
79# wish to tie your /usr/include and /usr/src together.
80#SHARED= symlinks
81SHARED?= copies
82
83INCS+= osreldate.h
84
85osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
86 ${.CURDIR}/../sys/sys/param.h
87 @${ECHO} creating osreldate.h from newvers.sh
88 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
89 . ${.CURDIR}/../sys/conf/newvers.sh; \
90 echo "$$COPYRIGHT" > osreldate.h; \
91 echo "#ifdef _KERNEL" >> osreldate.h; \
92 echo '#error "osreldate.h must not be used in the kernel, use sys/param.h"' >> osreldate.h; \
93 echo "#else" >> osreldate.h; \
94 echo \#'undef __FreeBSD_version' >> osreldate.h; \
95 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
96 echo "#endif" >> osreldate.h
97
98.for i in ${LHDRS}
99INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
100.endfor
101.for i in ${MHDRS}
102INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
103.endfor
104.for i in ${PHDRS}
435d74a4 105INCSLINKS+= emulation/posix4/$i ${INCLUDEDIR}/$i
984263bc 106.endfor
435d74a4
MD
107INCSLINKS+= bus/cam ${INCLUDEDIR}/cam
108INCSLINKS+= vfs/msdosfs ${INCLUDEDIR}/msdosfs
38a690d7
MD
109INCSLINKS+= vfs/isofs ${INCLUDEDIR}/isofs
110INCSLINKS+= vfs/mfs ${INCLUDEDIR}/mfs
435d74a4
MD
111INCSLINKS+= vfs/nfs ${INCLUDEDIR}/nfs
112INCSLINKS+= vfs/ntfs ${INCLUDEDIR}/ntfs
113INCSLINKS+= vfs/nwfs ${INCLUDEDIR}/nwfs
114INCSLINKS+= vfs ${INCLUDEDIR}/fs
38a690d7 115INCSLINKS+= emulation ${INCLUDEDIR}/compat
435d74a4
MD
116INCSLINKS+= netproto/atalk ${INCLUDEDIR}/netatalk
117INCSLINKS+= netproto/atm ${INCLUDEDIR}/netatm
118INCSLINKS+= netproto/ipsec ${INCLUDEDIR}/netipsec
119INCSLINKS+= netproto/ipx ${INCLUDEDIR}/netipx
120INCSLINKS+= netproto/key ${INCLUDEDIR}/netkey
121INCSLINKS+= netproto/natm ${INCLUDEDIR}/netnatm
122INCSLINKS+= netproto/ncp ${INCLUDEDIR}/netncp
123INCSLINKS+= netproto/ns ${INCLUDEDIR}/netns
124INCSLINKS+= netproto/smb ${INCLUDEDIR}/netsmb
125INCSLINKS+= bus/pccard ${INCLUDEDIR}/pccard
984263bc 126
38a690d7
MD
127mtree_setup:
128.for i in ${LDIRS} ${LSYMSUBDIRS} ${LSYMSUBDIRS3} machine crypto
984263bc
MD
129 if [ -h ${DESTDIR}/usr/include/$i ]; then \
130 rm -f ${DESTDIR}/usr/include/$i; \
131 fi
132.endfor
133 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
134 -p ${DESTDIR}/usr/include
38a690d7
MD
135
136copies: mtree_setup
137.for i in ${LDIRS} ${LSUBDIRS} ${LSUBDIRS3}
984263bc
MD
138 cd ${.CURDIR}/../sys; \
139 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
140 ${DESTDIR}/usr/include/$i
141.endfor
142 cd ${.CURDIR}/../sys; \
143 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
144 ${DESTDIR}/usr/include/crypto
145.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
146 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
147 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
148 ${DESTDIR}/usr/include/machine
149.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
150 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
151 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
152 ${DESTDIR}/usr/include/machine/pc
153.endif
154.endif
38a690d7
MD
155.if exists(${.CURDIR}/../sys/net/i4b/include/${MACHINE_ARCH})
156 cd ${.CURDIR}/../sys/net/i4b/include/${MACHINE_ARCH}; \
157 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
158 ${DESTDIR}/usr/include/i4b_machine
159.endif
984263bc
MD
160.for i in ${SHDRS}
161 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
162.endfor
163
38a690d7 164symlinks: mtree_setup
984263bc
MD
165 @${ECHO} "Setting up symlinks to kernel source tree..."
166.for i in ${LDIRS}
167 rm -rf ${DESTDIR}/usr/include/$i
168 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
169.endfor
170 rm -rf ${DESTDIR}/usr/include/crypto
171 ln -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
172.for i in ${LSYMSUBDIRS}
173 rm -rf ${DESTDIR}/usr/include/$i
174 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
38a690d7
MD
175.endfor
176.for i in ${LSYMSUBDIRS3}
177 rm -rf ${DESTDIR}/usr/include/$i
178 ln -s ../../../../sys/$i ${DESTDIR}/usr/include/$i
984263bc
MD
179.endfor
180 rm -rf ${DESTDIR}/usr/include/machine
181 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
38a690d7
MD
182 rm -rf ${DESTDIR}/usr/include/i4b_machine
183 ln -s ../../sys/net/i4b/include/${MACHINE_ARCH} ${DESTDIR}/usr/include/i4b_machine
984263bc
MD
184
185.include <bsd.prog.mk>
186
187installincludes: ${SHARED}