]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Makefile.lib32
o Document net.inet.icmp.maskfake and net.inet.icmp.tstamprepl sysctls.
[FreeBSD/FreeBSD.git] / Makefile.lib32
1 # $FreeBSD$
2
3 # Makefile for the 32-bit compat libraries on PowerPC and AMD64.
4 # could also be for mips, but that doesn't work today.
5
6 # 32 bit world
7 LIB32_OBJTREE=  ${OBJTREE}${.CURDIR}/world32
8 LIB32TMP=       ${OBJTREE}${.CURDIR}/lib32
9
10 .if ${TARGET_ARCH} == "amd64"
11 .if empty(TARGET_CPUTYPE)
12 LIB32CPUFLAGS=  -march=i686 -mmmx -msse -msse2
13 .else
14 LIB32CPUFLAGS=  -march=${TARGET_CPUTYPE}
15 .endif
16 LIB32WMAKEENV=  MACHINE=i386 MACHINE_ARCH=i386 \
17                 MACHINE_CPU="i686 mmx sse sse2"
18 LIB32WMAKEFLAGS=        \
19                 AS="${XAS} --32" \
20                 LD="${XLD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
21                 OBJCOPY="${XOBJCOPY}"
22
23 .elif ${TARGET_ARCH} == "powerpc64"
24 .if empty(TARGET_CPUTYPE)
25 LIB32CPUFLAGS=  -mcpu=powerpc
26 .else
27 LIB32CPUFLAGS=  -mcpu=${TARGET_CPUTYPE}
28 .endif
29 LIB32WMAKEENV=  MACHINE=powerpc MACHINE_ARCH=powerpc
30 LIB32WMAKEFLAGS=        \
31                 LD="${XLD} -m elf32ppc_fbsd" \
32                 OBJCOPY="${XOBJCOPY}"
33 .endif
34
35
36 LIB32FLAGS=     -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \
37                 -isystem ${LIB32TMP}/usr/include/ \
38                 -L${LIB32TMP}/usr/lib32 \
39                 -B${LIB32TMP}/usr/lib32
40 .if ${XCC:N${CCACHE_BIN}:M/*}
41 LIB32FLAGS+=            --sysroot=${WORLDTMP}
42 .endif
43
44 # Yes, the flags are redundant.
45 LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
46                 _LDSCRIPTROOT=${LIB32TMP} \
47                 INSTALL="sh ${.CURDIR}/tools/install.sh" \
48                 PATH=${TMPPATH} \
49                 LIBDIR=/usr/lib32 \
50                 SHLIBDIR=/usr/lib32 \
51                 DTRACE="${DTRACE} -32"
52 LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \
53                 CXX="${XCXX} ${LIB32FLAGS}" \
54                 DESTDIR=${LIB32TMP} \
55                 -DCOMPAT_32BIT \
56                 -DLIBRARIES_ONLY \
57                 -DNO_CPU_CFLAGS \
58                 MK_CTF=no \
59                 -DNO_LINT \
60                 MK_TESTS=no
61
62 LIB32WMAKE=     ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
63                 MK_MAN=no MK_HTML=no
64 LIB32IMAKE=     ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} \
65                 MK_TOOLCHAIN=no ${IMAKE_INSTALL}
66
67 build32: .PHONY
68         @echo
69         @echo "--------------------------------------------------------------"
70         @echo ">>> stage 5.1: building 32 bit shim libraries"
71         @echo "--------------------------------------------------------------"
72         mkdir -p ${LIB32TMP}/usr/include
73         mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
74             -p ${LIB32TMP}/usr >/dev/null
75         mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
76             -p ${LIB32TMP}/usr/include >/dev/null
77         mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
78             -p ${LIB32TMP}/usr >/dev/null
79 .if ${MK_DEBUG_FILES} != "no"
80         mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
81             -p ${LIB32TMP}/usr/lib >/dev/null
82         mtree -deU -f ${.CURDIR}/etc/mtree/BSD.lib32.dist \
83             -p ${LIB32TMP}/usr/lib/debug/usr >/dev/null
84 .endif
85         mkdir -p ${WORLDTMP}
86         ln -sf ${.CURDIR}/sys ${WORLDTMP}
87 .for _t in obj includes
88         ${_+_}cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t}
89         ${_+_}cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t}
90 .if ${MK_CDDL} != "no"
91         ${_+_}cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
92 .endif
93         ${_+_}cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
94 .if ${MK_CRYPT} != "no"
95         ${_+_}cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
96 .endif
97 .if ${MK_KERBEROS} != "no"
98         ${_+_}cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
99 .endif
100 .endfor
101 .for _dir in usr.bin/lex/lib
102         ${_+_}cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
103 .endfor
104 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
105         ${_+_}cd ${.CURDIR}/${_dir}; \
106             WORLDTMP=${WORLDTMP} \
107             MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
108             MAKEOBJDIRPREFIX=${LIB32_OBJTREE} ${MAKE} SSP_CFLAGS= DESTDIR= \
109             DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
110             build-tools
111 .endfor
112         ${_+_}cd ${.CURDIR}; \
113             ${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
114 .for _t in obj depend all
115         ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
116             -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
117         ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
118             DIRPRFX=usr.bin/ldd ${_t}
119 .endfor
120
121 distribute32 install32: .MAKE .PHONY
122         ${_+_}cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
123 .if ${MK_CDDL} != "no"
124         ${_+_}cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
125 .endif
126         ${_+_}cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
127 .if ${MK_CRYPT} != "no"
128         ${_+_}cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
129 .endif
130 .if ${MK_KERBEROS} != "no"
131         ${_+_}cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
132 .endif
133         ${_+_}cd ${.CURDIR}/libexec/rtld-elf; \
134             PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
135         ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} \
136             ${.TARGET:S/32$//}