/
Makefile
234 lines (214 loc) · 8.85 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# @(#)Makefile 8.2 (Berkeley) 1/4/94
# $FreeBSD: src/include/Makefile,v 1.109.2.27 2003/01/24 05:12:29 sam Exp $
#
# Doing a make install builds /usr/include
#
# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
# links.
CLEANFILES= osreldate.h version vers.c vers.txt
SUBDIR= arpa protocols rpc rpcsvc
INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h ctype.h db.h \
dirent.h disktab.h \
dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
fts.h ftw.h getopt.h glob.h grp.h histedit.h \
iconv.h ieeefp.h ifaddrs.h iso646.h inttypes.h \
langinfo.h libgen.h limits.h link.h locale.h malloc.h math.h memory.h \
mntopts.h mpool.h mqueue.h monetary.h ndbm.h netconfig.h \
netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h \
paths.h printf.h pthread.h pthread_np.h pwd.h \
ranlib.h readpassphrase.h regex.h regexp.h \
res_update.h resolv.h re_comp.h rmd160.h \
search.h setjmp.h sgtty.h \
signal.h spawn.h stab.h stdarg.h stdbool.h \
stddef.h stdint.h stdio.h stdlib.h \
string.h stringlist.h strings.h struct.h sysexits.h tar.h time.h \
timeconv.h \
timers.h ttyent.h tzfile.h unistd.h ulimit.h utime.h utmp.h utmpx.h \
uuid.h vis.h \
wchar.h wctype.h wordexp.h
.if defined(WANT_HESIOD)
INCS+= hesiod.h
.endif
MHDRS= float.h floatingpoint.h varargs.h
# Only for default SHARED=copies case
SHDRS= soundcard.h joystick.h
LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h sched.h \
semaphore.h syslog.h termios.h ucontext.h
# directories which also contain header files that need to be copied.
# Other directories, like 'bus' and 'netproto', are created using mtree.
#
# XXX allow these directories to not contain header files.
LDIRS= net netbt netgraph netgraph7 netinet netinet6 sys vm
# Subdirectories containing header files to copy. In symlink mode
# the subdirectory will be symlinked. Care must be taken to adjust
# LSYMSUBDIRS below to remove subdirectories whos parent directories.
# If you make a mistake, part of your source tree might get overwritten
# when buildworld is run.
#
LSUBDIRS= bus/cam bus/cam/scsi \
emulation/linux \
gnu/vfs/ext2fs \
vfs/msdosfs vfs/nfs vfs/ntfs vfs/nwfs \
vfs/smbfs vfs/udf vfs/ufs vfs/hammer \
net/vlan net/ipfw net/ip6fw net/dummynet net/sppp net/ip_mroute \
net/bridge net/tap net/tun net/ppp net/ppp_layer net/sl \
net/pf net/altq \
netgraph/UI netgraph/async netgraph/bpf netgraph/bridge \
netgraph/cisco netgraph/echo netgraph/eiface netgraph/etf \
netgraph/ether netgraph/fec netgraph/frame_relay netgraph/hole \
netgraph/iface netgraph/ksocket netgraph/l2tp netgraph/lmi \
netgraph/mppc netgraph/one2many netgraph/ppp \
netgraph/pppoe netgraph/pptpgre netgraph/rfc1490 netgraph/socket \
netgraph/tee netgraph/tty netgraph/vjc \
netgraph7/UI netgraph7/async netgraph7/atmllc netgraph7/bpf \
netgraph7/bridge netgraph7/cisco netgraph7/deflate netgraph7/echo \
netgraph7/etf netgraph7/ether netgraph7/frame_relay netgraph7/hole \
netgraph7/hub \
netgraph7/iface netgraph7/ksocket netgraph7/l2tp netgraph7/lmi \
netgraph7/mppc netgraph7/one2many netgraph7/ppp netgraph7/pppoe \
netgraph7/pptpgre netgraph7/rfc1490 netgraph7/socket \
netgraph7/tcpmss netgraph7/tee netgraph7/tty netgraph7/vjc \
bus/cam bus/pccard bus/pci bus/isa bus/ppbus bus/smbus \
netproto/atm netproto/ipsec netproto/ipx \
netproto/key netproto/natm netproto/ncp netproto/smb \
netproto/atm/ipatm netproto/atm/sigpvc netproto/atm/spans \
netproto/atm/uni netproto/802_11 netproto/mpls \
vfs/isofs/cd9660 vfs/puffs \
dev/disk/mpt/mpilib \
dev/disk/dm \
dev/misc/lpt dev/misc/ppi dev/misc/putter \
dev/netif/wi \
dev/raid/ciss dev/raid/mfi \
dev/video/bktr dev/video/meteor libprop
.if defined(WANT_USB4BSD)
LSUBDIRS+= bus/u4b
.else
LSUBDIRS+= bus/usb
.endif
# For SHARED=symlinks, bus/cam and netproto/atm are symlinks, so cam/scsi
# and netproto/atm/* are taken care of
LSYMSUBDIRS= ${LSUBDIRS:Nbus/cam/scsi:Nnetproto/atm/*:Nnet/*:Nnetgraph/*:Nnetgraph7/*}
# For obsolete headers which need to be removed
RMHEADERS= machine/ansi.h sys/inttypes.h
# Define SHARED to indicate whether you want symbolic links to the system
# source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is
# probably only useful for developers and should be avoided if you do not
# wish to tie your /usr/include and /usr/src together.
#SHARED= symlinks
SHARED?= copies
INCS+= osreldate.h
osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \
${.CURDIR}/../sys/sys/param.h
@${ECHO} creating osreldate.h from newvers.sh
setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \
. ${.CURDIR}/../sys/conf/newvers.sh; \
echo "$$COPYRIGHT" > osreldate.h; \
echo "#ifdef _KERNEL" >> osreldate.h; \
echo '#error "osreldate.h must not be used in the kernel, use sys/param.h"' >> osreldate.h; \
echo "#else" >> osreldate.h; \
echo "#undef __DragonFly_version" >> osreldate.h; \
echo "#define __DragonFly_version $$RELDATE" >> osreldate.h; \
echo "#endif" >> osreldate.h
.for i in ${LHDRS}
INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
.endfor
.for i in ${MHDRS}
INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
.endfor
INCSLINKS+= bus/cam ${INCLUDEDIR}/cam
INCSLINKS+= vfs/msdosfs ${INCLUDEDIR}/msdosfs
INCSLINKS+= vfs/isofs ${INCLUDEDIR}/isofs
INCSLINKS+= vfs/mfs ${INCLUDEDIR}/mfs
INCSLINKS+= vfs/nfs ${INCLUDEDIR}/nfs
INCSLINKS+= vfs/ntfs ${INCLUDEDIR}/ntfs
INCSLINKS+= vfs/nwfs ${INCLUDEDIR}/nwfs
INCSLINKS+= vfs ${INCLUDEDIR}/fs
# this is for <ufs/ufs/...> and <ufs/ffs/...> paths used by ports
# It is hopefully a temporary hack until we have environments working.
INCSLINKS+= vfs ${INCLUDEDIR}/ufs
INCSLINKS+= ufs ${INCLUDEDIR}/vfs/ffs
INCSLINKS+= emulation ${INCLUDEDIR}/compat
INCSLINKS+= netproto/atm ${INCLUDEDIR}/netatm
INCSLINKS+= netproto/ipsec ${INCLUDEDIR}/netipsec
INCSLINKS+= netproto/ipx ${INCLUDEDIR}/netipx
INCSLINKS+= netproto/key ${INCLUDEDIR}/netkey
INCSLINKS+= netproto/natm ${INCLUDEDIR}/netnatm
INCSLINKS+= netproto/ncp ${INCLUDEDIR}/netncp
INCSLINKS+= netproto/smb ${INCLUDEDIR}/netsmb
INCSLINKS+= bus/pccard ${INCLUDEDIR}/pccard
# NOTE!
#
# machine/ header files come from the platform architecture and
# cpu/ header files come from the cpu architecture. All code outside
# of the machine header files ALWAYS #include's <machine/blah.h>. So
# if the platform architecture is missing a header file we have to
# copy it in from the cpu architecture. This way we do not have to
# create dozens of pure forwarding headers for files that platform
# architecture does not need to enhance.
mtree_setup:
.for i in ${LDIRS} ${LSYMSUBDIRS} machine cpu crypto dev/acpica
if [ -h ${DESTDIR}/usr/include/$i ]; then \
rm -f ${DESTDIR}/usr/include/$i; \
fi
.endfor
mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \
-p ${DESTDIR}/usr/include
copies: mtree_setup
.for i in ${LDIRS} ${LSUBDIRS}
cd ${.CURDIR}/../sys; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
${DESTDIR}/usr/include/$i
.endfor
cd ${.CURDIR}/../sys; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 crypto/rijndael/rijndael.h \
${DESTDIR}/usr/include/crypto; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 opencrypto/*.h \
${DESTDIR}/usr/include/crypto
cd ${.CURDIR}/../sys/dev/acpica; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
${DESTDIR}/usr/include/dev/acpica
.if exists(${.CURDIR}/../sys/cpu/${MACHINE_ARCH}/include)
cd ${.CURDIR}/../sys/cpu/${MACHINE_ARCH}/include; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${DESTDIR}/usr/include/cpu
# XXX this will cause quickworld to rebuild more junk
# then it needs to.
cpdup -o ${DESTDIR}/usr/include/cpu ${DESTDIR}/usr/include/machine
.endif
.if exists(${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include)
cd ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${DESTDIR}/usr/include/machine
.if exists(${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include/pc)
cd ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include/pc; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${DESTDIR}/usr/include/machine/pc
.endif
.endif
.for i in ${SHDRS}
${LN} -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
.endfor
.for i in ${RMHEADERS}
rm -f ${DESTDIR}/usr/include/$i
.endfor
symlinks: mtree_setup
@${ECHO} "Setting up symlinks to kernel source tree..."
.for i in ${LDIRS}
rm -rf ${DESTDIR}/usr/include/$i
${LN} -s ../../sys/$i ${DESTDIR}/usr/include/$i
.endfor
rm -rf ${DESTDIR}/usr/include/crypto
${LN} -s ../../sys/opencrypto ${DESTDIR}/usr/include/crypto
.for i in ${LSYMSUBDIRS}
rm -rf ${DESTDIR}/usr/include/$i
${LN} -s ${i:C;[^/]+/?;../;g}../sys/$i ${DESTDIR}/usr/include/$i
.endfor
rm -rf ${DESTDIR}/usr/include/cpu
${LN} -s ../../sys/cpu/${MACHINE_ARCH}/include ${DESTDIR}/usr/include/cpu
rm -rf ${DESTDIR}/usr/include/machine
cpdup ${.CURDIR}/../sys/cpu/${MACHINE_ARCH}/include \
${DESTDIR}/usr/include/machine
cpdup -o ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include \
${DESTDIR}/usr/include/machine
.include <bsd.prog.mk>
installincludes: ${SHARED}