gcc4X: rework some makefiles
[dragonfly.git] / gnu / lib / gcc44 / libgcc / Makefile
CommitLineData
cdefb602
SS
1.include "../Makefile.inc"
2
3CFLAGS+= -I.
4CFLAGS+= -fexceptions
5CFLAGS+= -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -DHAVE_GTHR_DEFAULT
6CFLAGS+= -DIN_GCC
7
8LIB= gcc
9
10# used by shared libs
11INSTALL_PIC_ARCHIVE= yes
12
13lib2funcs = _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
23lib2funcs+= _fixuns$fsi
24.endfor
25.for f in sf df xf tf
26lib2funcs+= _fix$fdi _fixuns$fdi _float$fdi _floatun$fdi
27.endfor
28
29LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
30
31# from gcc/Makefile.in
32LIB2FUNCS_ST = _eprintf __gcc_bcmp
33
34
35FUNCS= ${lib2funcs} ${LIB2_DIVMOD_FUNCS} ${LIB2FUNCS_ST}
36
37SRCS+= ${FUNCS:S/$/.c/g}
38CLEANFILES+= ${FUNCS:S/$/.c/g}
39
40# LIB2ADDEH, gcc/Makefile
eae7a19e 41SRCS+= unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c
cdefb602
SS
42SRCS+= gthr-gnat.c unwind-c.c
43
44SRCS+= unwind.h
45
46unwind.h: unwind-generic.h
47 cp ${.ALLSRC} ${.TARGET}
48
49CLEANFILES+= 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
64ed7155 62# GCC's libgcc generates source files which depend on generated
cdefb602
SS
63# header files, which means we have to generate our tools set before
64# we can build libgcc. The toolset is normally built afterwards.
65#
66# XXX for the world stage we could theoretically use the cc_tools generated
67# in the btools stage, but it's easier to regenerate them.
68#
64ed7155
JM
69# Assumed to be built prior to this makefile:
70# gnu/usr.bin/cc44/cc_prep
71# gnu/usr.bin/cc44/cc_tools
cdefb602
SS
72
73.if ${GCC_CPU} == "i386"
74EXTRA_HEADERS = $(srcdir)/config/i386/cpuid.h $(srcdir)/config/i386/mmintrin.h \
75$(srcdir)/config/i386/mm3dnow.h $(srcdir)/config/i386/xmmintrin.h \
76$(srcdir)/config/i386/emmintrin.h $(srcdir)/config/i386/pmmintrin.h \
77$(srcdir)/config/i386/tmmintrin.h $(srcdir)/config/i386/ammintrin.h \
78$(srcdir)/config/i386/smmintrin.h $(srcdir)/config/i386/nmmintrin.h \
79$(srcdir)/config/i386/bmmintrin.h $(srcdir)/config/i386/mmintrin-common.h \
80$(srcdir)/config/i386/wmmintrin.h $(srcdir)/config/i386/immintrin.h \
81$(srcdir)/config/i386/x86intrin.h $(srcdir)/config/i386/avxintrin.h \
82$(srcdir)/config/i386/cross-stdarg.h $(srcdir)/ginclude/tgmath.h
83
b617f4a5
SS
84SRCS+= mm_malloc.h
85
86mm_malloc.h: pmm_malloc.h
87 cp ${.ALLSRC} ${.TARGET}
88
89CLEANFILES+= mm_malloc.h
90
91INCS= ${EXTRA_HEADERS} mm_malloc.h
cdefb602
SS
92INCSDIR= /usr/libdata/gcc${GCCSHORTVER}
93.endif
94
95.include <bsd.lib.mk>