Remove two mis-added .orig files.
[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 $
300b182b 3# $DragonFly: src/include/Makefile,v 1.18 2004/05/15 18:12:01 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 \
3785c95a 15 fts.h getopt.h glob.h grp.h histedit.h ieeefp.h ifaddrs.h \
984168ec 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
300b182b 37# directories which also contain header files that need to be copied.
38a690d7
MD
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 \
4a77c3ab 53 vfs/smbfs vfs/udf vfs/ufs \
38a690d7
MD
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 69LSUBDIRS3= vfs/isofs/cd9660 net/i4b/include \
300b182b 70 dev/misc/lpt dev/netif/wi dev/video/bktr dev/video/meteor
38a690d7
MD
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; \
667ad1b9
MD
98 echo "#undef __DragonFly_version" >> osreldate.h; \
99 echo "#define __DragonFly_version $$RELDATE" >> osreldate.h; \
100 echo "#ifdef __FreeBSD__" >> osreldate.h; \
101 echo "#undef __FreeBSD_version" >> osreldate.h; \
102 echo "#define __FreeBSD_version 480101" >> osreldate.h; \
103 echo "#endif" >> osreldate.h; \
984263bc
MD
104 echo "#endif" >> osreldate.h
105
106.for i in ${LHDRS}
107INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
108.endfor
109.for i in ${MHDRS}
110INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
111.endfor
112.for i in ${PHDRS}
435d74a4 113INCSLINKS+= emulation/posix4/$i ${INCLUDEDIR}/$i
984263bc 114.endfor
435d74a4
MD
115INCSLINKS+= bus/cam ${INCLUDEDIR}/cam
116INCSLINKS+= vfs/msdosfs ${INCLUDEDIR}/msdosfs
38a690d7
MD
117INCSLINKS+= vfs/isofs ${INCLUDEDIR}/isofs
118INCSLINKS+= vfs/mfs ${INCLUDEDIR}/mfs
435d74a4
MD
119INCSLINKS+= vfs/nfs ${INCLUDEDIR}/nfs
120INCSLINKS+= vfs/ntfs ${INCLUDEDIR}/ntfs
121INCSLINKS+= vfs/nwfs ${INCLUDEDIR}/nwfs
122INCSLINKS+= vfs ${INCLUDEDIR}/fs
03e15c12
MD
123# this is for <ufs/ufs/...> and <ufs/ffs/...> paths used by ports
124# It is hopefully a temporary hack until we have environments working.
125INCSLINKS+= vfs ${INCLUDEDIR}/ufs
126INCSLINKS+= ufs ${INCLUDEDIR}/vfs/ffs
38a690d7 127INCSLINKS+= emulation ${INCLUDEDIR}/compat
435d74a4
MD
128INCSLINKS+= netproto/atalk ${INCLUDEDIR}/netatalk
129INCSLINKS+= netproto/atm ${INCLUDEDIR}/netatm
130INCSLINKS+= netproto/ipsec ${INCLUDEDIR}/netipsec
131INCSLINKS+= netproto/ipx ${INCLUDEDIR}/netipx
132INCSLINKS+= netproto/key ${INCLUDEDIR}/netkey
133INCSLINKS+= netproto/natm ${INCLUDEDIR}/netnatm
134INCSLINKS+= netproto/ncp ${INCLUDEDIR}/netncp
135INCSLINKS+= netproto/ns ${INCLUDEDIR}/netns
136INCSLINKS+= netproto/smb ${INCLUDEDIR}/netsmb
137INCSLINKS+= bus/pccard ${INCLUDEDIR}/pccard
300b182b
JS
138# this is for TV apps from ports.
139INCSLINKS+= ../dev/video/bktr/ioctl_bt848.h ${INCLUDEDIR}/machine/ioctl_bt848.h
140INCSLINKS+= ../dev/video/meteor/ioctl_meteor.h ${INCLUDEDIR}/machine/ioctl_meteor.h
984263bc 141
38a690d7
MD
142mtree_setup:
143.for i in ${LDIRS} ${LSYMSUBDIRS} ${LSYMSUBDIRS3} machine crypto
984263bc
MD
144 if [ -h ${DESTDIR}/usr/include/$i ]; then \
145 rm -f ${DESTDIR}/usr/include/$i; \
146 fi
147.endfor
148 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
149 -p ${DESTDIR}/usr/include
38a690d7
MD
150
151copies: mtree_setup
152.for i in ${LDIRS} ${LSUBDIRS} ${LSUBDIRS3}
984263bc
MD
153 cd ${.CURDIR}/../sys; \
154 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
155 ${DESTDIR}/usr/include/$i
156.endfor
157 cd ${.CURDIR}/../sys; \
158 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
159 ${DESTDIR}/usr/include/crypto
160.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
161 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
162 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
163 ${DESTDIR}/usr/include/machine
164.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
165 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
166 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
167 ${DESTDIR}/usr/include/machine/pc
168.endif
169.endif
38a690d7
MD
170.if exists(${.CURDIR}/../sys/net/i4b/include/${MACHINE_ARCH})
171 cd ${.CURDIR}/../sys/net/i4b/include/${MACHINE_ARCH}; \
172 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
173 ${DESTDIR}/usr/include/i4b_machine
174.endif
984263bc
MD
175.for i in ${SHDRS}
176 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
177.endfor
b326e0b1
MD
178.for i in ${RMHEADERS}
179 rm -f ${DESTDIR}/usr/include/$i
180.endfor
984263bc 181
38a690d7 182symlinks: mtree_setup
984263bc
MD
183 @${ECHO} "Setting up symlinks to kernel source tree..."
184.for i in ${LDIRS}
185 rm -rf ${DESTDIR}/usr/include/$i
186 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
187.endfor
188 rm -rf ${DESTDIR}/usr/include/crypto
189 ln -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
190.for i in ${LSYMSUBDIRS}
191 rm -rf ${DESTDIR}/usr/include/$i
192 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
38a690d7
MD
193.endfor
194.for i in ${LSYMSUBDIRS3}
195 rm -rf ${DESTDIR}/usr/include/$i
196 ln -s ../../../../sys/$i ${DESTDIR}/usr/include/$i
984263bc
MD
197.endfor
198 rm -rf ${DESTDIR}/usr/include/machine
199 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
38a690d7
MD
200 rm -rf ${DESTDIR}/usr/include/i4b_machine
201 ln -s ../../sys/net/i4b/include/${MACHINE_ARCH} ${DESTDIR}/usr/include/i4b_machine
984263bc
MD
202
203.include <bsd.prog.mk>
204
205installincludes: ${SHARED}