Remove math.h from Makefile, it gets installed through lib/msun/Makefile.
[dragonfly.git] / include / Makefile
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 $
3 # $DragonFly: src/include/Makefile,v 1.6 2003/08/09 22:00:54 asmodai Exp $
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
10 CLEANFILES= osreldate.h version vers.c
11 SUBDIR= arpa protocols rpc rpcsvc
12 INCS=   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 \
16         langinfo.h libgen.h limits.h link.h locale.h malloc.h memory.h \
17         mpool.h ndbm.h netdb.h nl_types.h nlist.h objformat.h \
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
25 MHDRS=  float.h floatingpoint.h stdarg.h varargs.h
26
27 # posix4/aio.h conflicts with dysons and isn't installed:
28 PHDRS=  mqueue.h sched.h semaphore.h # aio.h
29
30 # Only for default SHARED=copies case
31 SHDRS=  soundcard.h joystick.h
32
33 LHDRS=  aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \
34         termios.h ucontext.h
35
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.
40 LDIRS=  net netgraph netinet netinet6 sys vm
41
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 #
48 LSUBDIRS=       bus/cam bus/cam/scsi \
49         emulation/posix4 \
50         emulation/linux \
51         vfs/msdosfs vfs/nfs vfs/ntfs vfs/nwfs \
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 \
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 \
66         netproto/atm/uni
67
68 LSUBDIRS3= 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
73 LSYMSUBDIRS=    ${LSUBDIRS:Nbus/cam/scsi:Nnetproto/atm/*:Nnet/*:Nnetgraph/*}
74 LSYMSUBDIRS3=   ${LSUBDIRS3:Nnet/*}
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
81 SHARED?=        copies
82
83 INCS+=  osreldate.h
84
85 osreldate.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}
99 INCSLINKS+=     sys/$i ${INCLUDEDIR}/$i
100 .endfor
101 .for i in ${MHDRS}
102 INCSLINKS+=     machine/$i ${INCLUDEDIR}/$i
103 .endfor
104 .for i in ${PHDRS}
105 INCSLINKS+=     emulation/posix4/$i ${INCLUDEDIR}/$i
106 .endfor
107 INCSLINKS+=     bus/cam ${INCLUDEDIR}/cam
108 INCSLINKS+=     vfs/msdosfs ${INCLUDEDIR}/msdosfs
109 INCSLINKS+=     vfs/isofs ${INCLUDEDIR}/isofs
110 INCSLINKS+=     vfs/mfs ${INCLUDEDIR}/mfs
111 INCSLINKS+=     vfs/nfs ${INCLUDEDIR}/nfs
112 INCSLINKS+=     vfs/ntfs ${INCLUDEDIR}/ntfs
113 INCSLINKS+=     vfs/nwfs ${INCLUDEDIR}/nwfs
114 INCSLINKS+=     vfs ${INCLUDEDIR}/fs
115 INCSLINKS+=     emulation ${INCLUDEDIR}/compat
116 INCSLINKS+=     netproto/atalk ${INCLUDEDIR}/netatalk
117 INCSLINKS+=     netproto/atm ${INCLUDEDIR}/netatm
118 INCSLINKS+=     netproto/ipsec ${INCLUDEDIR}/netipsec
119 INCSLINKS+=     netproto/ipx ${INCLUDEDIR}/netipx
120 INCSLINKS+=     netproto/key ${INCLUDEDIR}/netkey
121 INCSLINKS+=     netproto/natm ${INCLUDEDIR}/netnatm
122 INCSLINKS+=     netproto/ncp ${INCLUDEDIR}/netncp
123 INCSLINKS+=     netproto/ns ${INCLUDEDIR}/netns
124 INCSLINKS+=     netproto/smb ${INCLUDEDIR}/netsmb
125 INCSLINKS+=     bus/pccard ${INCLUDEDIR}/pccard
126
127 mtree_setup:
128 .for i in ${LDIRS} ${LSYMSUBDIRS} ${LSYMSUBDIRS3} machine crypto
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
135
136 copies:         mtree_setup
137 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBDIRS3}
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
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
160 .for i in ${SHDRS}
161         ln -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
162 .endfor
163
164 symlinks:       mtree_setup
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
175 .endfor
176 .for i in ${LSYMSUBDIRS3}
177         rm -rf ${DESTDIR}/usr/include/$i
178         ln -s ../../../../sys/$i ${DESTDIR}/usr/include/$i
179 .endfor
180         rm -rf ${DESTDIR}/usr/include/machine
181         ln -s ../../sys/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/machine
182         rm -rf ${DESTDIR}/usr/include/i4b_machine
183         ln -s ../../sys/net/i4b/include/${MACHINE_ARCH} ${DESTDIR}/usr/include/i4b_machine
184
185 .include <bsd.prog.mk>
186
187 installincludes: ${SHARED}