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