libgcc.a47: build with -fpic
[dragonfly.git] / gnu / lib / gcc47 / libgcc / Makefile
1 .include "../Makefile.inc"
2 .include "Makefile.src"
3 .PATH: ${GCCDIR}/libgcc
4 .PATH: ${GCCDIR}/libgcc/soft-fp
5 .PATH: ${GCCDIR}/libgcc/config/i386
6
7 LIB=            gcc
8
9 CFLAGS+=        -I${.CURDIR}
10 CFLAGS+=        -I${.OBJDIR}
11 CFLAGS+=        -I${GCCDIR}/libgcc
12 CFLAGS+=        -I${GCCDIR}/libgcc/config/i386
13 CFLAGS+=        -I../csu
14 CFLAGS+=        -fbuilding-libgcc
15 CFLAGS+=        -fno-stack-protector
16 CFLAGS+=        -fvisibility=hidden
17 CFLAGS+=        -fpic
18 CFLAGS+=        -DPIC
19 CFLAGS+=        -DIN_GCC
20 CFLAGS+=        -DIN_LIBGCC2
21 CFLAGS+=        -DHAVE_CC_TLS
22 CFLAGS+=        -DHIDE_EXPORTS
23
24 # FUNCS and SOFTFUNCS defined in Makefile.src
25 SRCS+=          ${FUNCS:S/$/.c/} ${SOFTFUNCS:S/$/.c/}
26 CLEANFILES+=    ${FUNCS:S/$/.c/}
27
28 #generated sources
29 SRCS+=  gthr-default.h sfp-machine.h
30
31 beforedepend: cc_prep cc_tools csu
32 .ORDER: cc_prep cc_tools csu ${SRCS}
33
34 # This is kinda messy, but it's easier then rearranging the top level
35 # build.  gcc's libgcc generates source files which depend on generated
36 # header files, which means we have to generate our tools set before
37 # we can build libgcc.  The toolset is normally built afterwards.
38 #
39 # XXX for the world stage we could theoretically use the cc_tools generated
40 # in the btools stage, but it's easier to regenerate them.
41 #
42 cc_prep: .PHONY
43         cd ${CCDIR}/cc_prep; ${MAKE} depend
44
45 cc_tools: .PHONY
46         cd ${CCDIR}/cc_tools; ${MAKE} depend
47
48 csu: .PHONY
49         cd ${.CURDIR}/../csu; ${MAKE} depend
50
51 .if ${GCC_CPU} == "i386"
52 EXTRA_HEADERS = \
53         ${GCCDIR}/gcc/config/i386/ammintrin.h \
54         ${GCCDIR}/gcc/config/i386/avx2intrin.h \
55         ${GCCDIR}/gcc/config/i386/avxintrin.h \
56         ${GCCDIR}/gcc/config/i386/bmi2intrin.h \
57         ${GCCDIR}/gcc/config/i386/bmiintrin.h \
58         ${GCCDIR}/gcc/config/i386/bmmintrin.h \
59         ${GCCDIR}/gcc/config/i386/emmintrin.h \
60         ${GCCDIR}/gcc/config/i386/f16cintrin.h \
61         ${GCCDIR}/gcc/config/i386/fma4intrin.h \
62         ${GCCDIR}/gcc/config/i386/fmaintrin.h \
63         ${GCCDIR}/gcc/config/i386/ia32intrin.h \
64         ${GCCDIR}/gcc/config/i386/immintrin.h \
65         ${GCCDIR}/gcc/config/i386/lwpintrin.h \
66         ${GCCDIR}/gcc/config/i386/lzcntintrin.h \
67         ${GCCDIR}/gcc/config/i386/mmintrin.h \
68         ${GCCDIR}/gcc/config/i386/nmmintrin.h \
69         ${GCCDIR}/gcc/config/i386/pmmintrin.h \
70         ${GCCDIR}/gcc/config/i386/popcntintrin.h \
71         ${GCCDIR}/gcc/config/i386/smmintrin.h \
72         ${GCCDIR}/gcc/config/i386/tbmintrin.h \
73         ${GCCDIR}/gcc/config/i386/tmmintrin.h \
74         ${GCCDIR}/gcc/config/i386/wmmintrin.h \
75         ${GCCDIR}/gcc/config/i386/x86intrin.h \
76         ${GCCDIR}/gcc/config/i386/xmmintrin.h \
77         ${GCCDIR}/gcc/config/i386/xopintrin.h \
78         ${GCCDIR}/gcc/config/i386/cpuid.h \
79         ${GCCDIR}/gcc/config/i386/mm3dnow.h \
80         ${GCCDIR}/gcc/config/i386/cross-stdarg.h \
81         ${GCCDIR}/gcc/ginclude/tgmath.h
82
83 #generated sources
84 SRCS+=  mm_malloc.h unwind.h
85
86 INCS=           ${EXTRA_HEADERS} mm_malloc.h unwind.h
87 INCSDIR=        /usr/libdata/gcc${GCCSHORTVER}
88 .endif
89
90 mm_malloc.h: ${GCCDIR}/gcc/config/i386/gmm_malloc.h
91         cp ${.ALLSRC} ${.TARGET}
92
93 gthr-default.h: gthr-posix.h
94         cp ${.ALLSRC} ${.TARGET}
95
96 sfp-machine.h: ${GCCDIR}/libgcc/config/i386/sfp-machine.h
97         cp ${.ALLSRC} ${.TARGET}
98
99 enable-execute-stack.c: enable-execute-stack-freebsd.c
100         cp ${.ALLSRC} ${.TARGET}
101
102 unwind.h: unwind-generic.h
103         cp ${.ALLSRC} ${.TARGET}
104
105 CLEANFILES+=    mm_malloc.h unwind.h gthr-default.h enable-execute-stack.c
106
107 .include <bsd.lib.mk>