Fix bug in last syscall separation commit, an extra semicolon was causing
[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 $
e2565a42 3# $DragonFly: src/include/Makefile,v 1.9 2003/11/09 02:22:28 dillon 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 \
e2565a42 16 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 \
534bda7a 20 ranlib.h readpassphrase.h regex.h regexp.h resolv.h rmd160.h rune.h \
e2565a42
MD
21 runetype.h search.h setjmp.h sgtty.h \
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
MD
76
77# Define SHARED to indicate whether you want symbolic links to the system
78# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
79# probably only useful for developers and should be avoided if you do not
80# wish to tie your /usr/include and /usr/src together.
81#SHARED= symlinks
82SHARED?= copies
83
84INCS+= osreldate.h
85
86osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
87 ${.CURDIR}/../sys/sys/param.h
88 @${ECHO} creating osreldate.h from newvers.sh
89 setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
90 . ${.CURDIR}/../sys/conf/newvers.sh; \
91 echo "$$COPYRIGHT" > osreldate.h; \
92 echo "#ifdef _KERNEL" >> osreldate.h; \
93 echo '#error "osreldate.h must not be used in the kernel, use sys/param.h"' >> osreldate.h; \
94 echo "#else" >> osreldate.h; \
95 echo \#'undef __FreeBSD_version' >> osreldate.h; \
96 echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h; \
97 echo "#endif" >> osreldate.h
98
99.for i in ${LHDRS}
100INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
101.endfor
102.for i in ${MHDRS}
103INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
104.endfor
105.for i in ${PHDRS}
435d74a4 106INCSLINKS+= emulation/posix4/$i ${INCLUDEDIR}/$i
984263bc 107.endfor
435d74a4
MD
108INCSLINKS+= bus/cam ${INCLUDEDIR}/cam
109INCSLINKS+= vfs/msdosfs ${INCLUDEDIR}/msdosfs
38a690d7
MD
110INCSLINKS+= vfs/isofs ${INCLUDEDIR}/isofs
111INCSLINKS+= vfs/mfs ${INCLUDEDIR}/mfs
435d74a4
MD
112INCSLINKS+= vfs/nfs ${INCLUDEDIR}/nfs
113INCSLINKS+= vfs/ntfs ${INCLUDEDIR}/ntfs
114INCSLINKS+= vfs/nwfs ${INCLUDEDIR}/nwfs
115INCSLINKS+= vfs ${INCLUDEDIR}/fs
03e15c12
MD
116# this is for <ufs/ufs/...> and <ufs/ffs/...> paths used by ports
117# It is hopefully a temporary hack until we have environments working.
118INCSLINKS+= vfs ${INCLUDEDIR}/ufs
119INCSLINKS+= ufs ${INCLUDEDIR}/vfs/ffs
38a690d7 120INCSLINKS+= emulation ${INCLUDEDIR}/compat
435d74a4
MD
121INCSLINKS+= netproto/atalk ${INCLUDEDIR}/netatalk
122INCSLINKS+= netproto/atm ${INCLUDEDIR}/netatm
123INCSLINKS+= netproto/ipsec ${INCLUDEDIR}/netipsec
124INCSLINKS+= netproto/ipx ${INCLUDEDIR}/netipx
125INCSLINKS+= netproto/key ${INCLUDEDIR}/netkey
126INCSLINKS+= netproto/natm ${INCLUDEDIR}/netnatm
127INCSLINKS+= netproto/ncp ${INCLUDEDIR}/netncp
128INCSLINKS+= netproto/ns ${INCLUDEDIR}/netns
129INCSLINKS+= netproto/smb ${INCLUDEDIR}/netsmb
130INCSLINKS+= bus/pccard ${INCLUDEDIR}/pccard
984263bc 131
38a690d7
MD
132mtree_setup:
133.for i in ${LDIRS} ${LSYMSUBDIRS} ${LSYMSUBDIRS3} machine crypto
984263bc
MD
134 if [ -h ${DESTDIR}/usr/include/$i ]; then \
135 rm -f ${DESTDIR}/usr/include/$i; \
136 fi
137.endfor
138 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
139 -p ${DESTDIR}/usr/include
38a690d7
MD
140
141copies: mtree_setup
142.for i in ${LDIRS} ${LSUBDIRS} ${LSUBDIRS3}
984263bc
MD
143 cd ${.CURDIR}/../sys; \
144 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
145 ${DESTDIR}/usr/include/$i
146.endfor
147 cd ${.CURDIR}/../sys; \
148 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
149 ${DESTDIR}/usr/include/crypto
150.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include)
151 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include; \
152 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
153 ${DESTDIR}/usr/include/machine
154.if exists(${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc)
155 cd ${.CURDIR}/../sys/${MACHINE_ARCH}/include/pc; \
156 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
157 ${DESTDIR}/usr/include/machine/pc
158.endif
159.endif
38a690d7
MD
160.if exists(${.CURDIR}/../sys/net/i4b/include/${MACHINE_ARCH})
161 cd ${.CURDIR}/../sys/net/i4b/include/${MACHINE_ARCH}; \
162 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
163 ${DESTDIR}/usr/include/i4b_machine
164.endif
984263bc
MD
165.for i in ${SHDRS}
166 ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
167.endfor
168
38a690d7 169symlinks: mtree_setup
984263bc
MD
170 @${ECHO} "Setting up symlinks to kernel source tree..."
171.for i in ${LDIRS}
172 rm -rf ${DESTDIR}/usr/include/$i
173 ln -s ../../sys/$i ${DESTDIR}/usr/include/$i
174.endfor
175 rm -rf ${DESTDIR}/usr/include/crypto
176 ln -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
177.for i in ${LSYMSUBDIRS}
178 rm -rf ${DESTDIR}/usr/include/$i
179 ln -s ../../../sys/$i ${DESTDIR}/usr/include/$i
38a690d7
MD
180.endfor
181.for i in ${LSYMSUBDIRS3}
182 rm -rf ${DESTDIR}/usr/include/$i
183 ln -s ../../../../sys/$i ${DESTDIR}/usr/include/$i
984263bc
MD
184.endfor
185 rm -rf ${DESTDIR}/usr/include/machine
186 ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
38a690d7
MD
187 rm -rf ${DESTDIR}/usr/include/i4b_machine
188 ln -s ../../sys/net/i4b/include/${MACHINE_ARCH} ${DESTDIR}/usr/include/i4b_machine
984263bc
MD
189
190.include <bsd.prog.mk>
191
192installincludes: ${SHARED}