gcc44: import build infrastructure
[dragonfly.git] / gnu / lib / gcc44 / libgcc / Makefile
1 .include "../Makefile.inc"
2
3 CFLAGS+=        -I.
4 CFLAGS+=        -fexceptions
5 CFLAGS+=        -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -DHAVE_GTHR_DEFAULT
6 CFLAGS+=        -DIN_GCC
7
8 LIB=            gcc
9
10 # used by shared libs
11 INSTALL_PIC_ARCHIVE=    yes
12
13 lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2    \
14             _clear_cache _enable_execute_stack _trampoline __main _absvsi2 \
15             _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \
16             _negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2  \
17             _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2        \
18             _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2      \
19             _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3        \
20             _divtc3 _bswapsi2 _bswapdi2
21
22 .for f in sf df xf
23 lib2funcs+=     _fixuns$fsi
24 .endfor
25 .for f in sf df xf tf
26 lib2funcs+=     _fix$fdi _fixuns$fdi _float$fdi _floatun$fdi
27 .endfor
28
29 LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
30
31 # from gcc/Makefile.in
32 LIB2FUNCS_ST = _eprintf __gcc_bcmp
33
34
35 FUNCS=  ${lib2funcs} ${LIB2_DIVMOD_FUNCS} ${LIB2FUNCS_ST}
36
37 SRCS+=          ${FUNCS:S/$/.c/g}
38 CLEANFILES+=    ${FUNCS:S/$/.c/g}
39
40 # LIB2ADDEH, gcc/Makefile
41 SRCS+=  unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c
42 SRCS+=  gthr-gnat.c unwind-c.c
43
44 SRCS+=  unwind.h
45
46 unwind.h: unwind-generic.h
47         cp ${.ALLSRC} ${.TARGET}
48
49 CLEANFILES+=    unwind.h
50
51 .for F in ${FUNCS}
52 ${F}.c:
53         echo '#define L${.TARGET:T:R}' > ${.TARGET}
54         echo '#include "libgcc2.c"' >> ${.TARGET}
55 .endfor
56
57 .for F in ${LIB2_DIVMOD_FUNCS}
58 ${F}.o: ${F}.c
59         ${CC} ${CFLAGS} -fnon-call-exceptions -c ${.IMPSRC}
60 .endfor
61
62 beforedepend: cc_prep cc_tools
63 .ORDER: cc_prep cc_tools ${SRCS}
64
65 # This is kinda messy, but it's easier then rearranging the top level
66 # build.  gcc's libgcc generates source files which depend on generated
67 # header files, which means we have to generate our tools set before
68 # we can build libgcc.  The toolset is normally built afterwards.
69 #
70 # XXX for the world stage we could theoretically use the cc_tools generated
71 # in the btools stage, but it's easier to regenerate them.
72 #
73 cc_prep: .PHONY
74         cd ${STOPDIR}/cc_prep; ${MAKE} depend
75
76 cc_tools: .PHONY
77         cd ${STOPDIR}/cc_tools; ${MAKE} depend
78
79 .if ${GCC_CPU} == "i386"
80 EXTRA_HEADERS = $(srcdir)/config/i386/cpuid.h $(srcdir)/config/i386/mmintrin.h \
81 $(srcdir)/config/i386/mm3dnow.h $(srcdir)/config/i386/xmmintrin.h \
82 $(srcdir)/config/i386/emmintrin.h $(srcdir)/config/i386/pmmintrin.h \
83 $(srcdir)/config/i386/tmmintrin.h $(srcdir)/config/i386/ammintrin.h \
84 $(srcdir)/config/i386/smmintrin.h $(srcdir)/config/i386/nmmintrin.h \
85 $(srcdir)/config/i386/bmmintrin.h $(srcdir)/config/i386/mmintrin-common.h \
86 $(srcdir)/config/i386/wmmintrin.h $(srcdir)/config/i386/immintrin.h \
87 $(srcdir)/config/i386/x86intrin.h $(srcdir)/config/i386/avxintrin.h \
88 $(srcdir)/config/i386/cross-stdarg.h $(srcdir)/ginclude/tgmath.h
89
90 INCS=           ${EXTRA_HEADERS}
91 INCSDIR=        /usr/libdata/gcc${GCCSHORTVER}
92 .endif
93
94 .include <bsd.lib.mk>