1 # $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.31.2.2 2002/06/20 23:13:29 obrien Exp $
3 GCCDIR= ${.CURDIR}/../../../contrib/gcc
5 .PATH: ${GCCDIR}/cp ${GCCDIR}
7 # allow to be overridden for the a.out case
8 .if !defined(LIB) || ${LIB} != "gcc_r"
12 .if ${OBJFORMAT} == aout
13 # Install libgcc_pic.a, since ld.so uses it.
14 INSTALL_PIC_ARCHIVE= yes
18 # XXX This is a hack, but it seems to work. libgcc1.a is supposed to be
19 # compiled by the native compiler, and libgcc2.a is meant to be compiled
20 # by *this* version of gcc.
22 # Normally, this does not make any difference, since we only have gcc, but
23 # when bootstrapping from gcc-2.6.3, we have to use the freshly built 2.7.2
24 # compiler for some of the libgcc2.c __attribute__ stuff.
26 # We now depend on a bootstrap pass (normally in `make world') to build
27 # and install the new version of gcc before we get here. This makes
28 # finding the new version (XCC) easy but may break finding the old version
34 # Members of libgcc1.a.
35 LIB1FUNCS= _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
36 _lshrsi3 _ashrsi3 _ashlsi3 \
37 _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
38 _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
39 _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
40 _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
41 _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
43 # Library members defined in libgcc2.c.
44 LIB2FUNCS= _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
45 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
46 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
47 _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
48 _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
49 _fixtfdi _fixunstfdi _floatditf \
50 __gcc_bcmp _varargs __dummy _eprintf \
51 _bb _shtab _clear_cache _trampoline __main _exit _ctors \
54 # Library members defined in new1.cc.
55 NEW1FUNCS= _op_new _op_newnt
57 # Library members defined in new2.cc.
58 NEW2FUNCS= _op_vnew _op_vnewnt _op_delete _op_delnt _op_vdel _op_vdelnt
60 SRCS= frame.c tinfo.cc tinfo2.cc new.cc exception.cc
64 .if ${OBJFORMAT} != aout
65 CFLAGS+= -D_PTHREADS -DGTHREAD_USE_WEAK
67 CFLAGS+= -I${GCCDIR}/config -I${GCCDIR} -I.
68 CXXFLAGS+= -I${GCCDIR}/cp/inc
69 CXXFLAGS+= -nostdinc++
71 COMMONHDRS= config.h tconfig.h tm.h
72 CLEANFILES+= ${COMMONHDRS}
75 LIB1OBJS= ${LIB1FUNCS:S/$/.o/}
76 LIB2OBJS= ${LIB2FUNCS:S/$/.o/}
77 LIB1SOBJS= ${LIB1FUNCS:S/$/.So/}
78 LIB2SOBJS= ${LIB2FUNCS:S/$/.So/}
79 LIB1POBJS= ${LIB1FUNCS:S/$/.po/}
80 LIB2POBJS= ${LIB2FUNCS:S/$/.po/}
81 NEW1OBJS= ${NEW1FUNCS:S/$/.o/}
82 NEW2OBJS= ${NEW2FUNCS:S/$/.o/}
83 NEW1SOBJS= ${NEW1FUNCS:S/$/.So/}
84 NEW2SOBJS= ${NEW2FUNCS:S/$/.So/}
85 NEW1POBJS= ${NEW1FUNCS:S/$/.po/}
86 NEW2POBJS= ${NEW2FUNCS:S/$/.po/}
88 OBJS= ${LIB1OBJS} ${LIB2OBJS} ${NEW1OBJS} ${NEW2OBJS}
91 echo '#include <${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h>' > ${.TARGET}
92 echo '#include <xm-freebsd.h>' >> ${.TARGET}
95 echo '#include "gansidecl.h"' > ${.TARGET}
96 echo '#include "${MACHINE_ARCH}/xm-${MACHINE_ARCH}.h"' >> ${.TARGET}
98 # KEEP THIS IN SYNC with src/gcc/usr.bin/cc/cc_tools/Makefile !!
100 echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"' > ${.TARGET}
101 .if ${MACHINE_ARCH} == "i386"
102 echo '#include "${MACHINE_ARCH}/att.h"' >> ${.TARGET}
104 echo '#include <freebsd.h>' >> ${.TARGET}
105 echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET}
106 .if ${MACHINE_ARCH} == "i386"
107 echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET}
110 ${OBJS}: ${COMMONHDRS}
112 ${LIB1OBJS}: libgcc1.c
113 ${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
114 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
115 @mv ${.TARGET}.tmp ${.TARGET}
117 ${LIB2OBJS}: libgcc2.c
118 ${XCC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
119 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
120 @mv ${.TARGET}.tmp ${.TARGET}
123 ${XCXX} -c ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
124 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
125 @mv ${.TARGET}.tmp ${.TARGET}
128 ${CXX} -c ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
129 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
130 @mv ${.TARGET}.tmp ${.TARGET}
133 ${LIB1SOBJS}: libgcc1.c
134 ${CC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
135 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
136 @mv ${.TARGET}.tmp ${.TARGET}
138 ${LIB2SOBJS}: libgcc2.c
139 ${XCC} -c ${PICFLAG} ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
140 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
141 @mv ${.TARGET}.tmp ${.TARGET}
143 ${NEW1SOBJS}: new1.cc
144 ${XCXX} -c ${PICFLAG} ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
145 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
146 @mv ${.TARGET}.tmp ${.TARGET}
148 ${NEW2SOBJS}: new2.cc
149 ${CXX} -c ${PICFLAG} ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
150 @${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
151 @mv ${.TARGET}.tmp ${.TARGET}
154 .if !defined(NOPROFILE)
155 ${LIB1POBJS}: libgcc1.c
156 ${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
157 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
158 @mv ${.TARGET}.tmp ${.TARGET}
160 ${LIB2POBJS}: libgcc2.c
161 ${XCC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
162 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
163 @mv ${.TARGET}.tmp ${.TARGET}
165 ${NEW1POBJS}: new1.cc
166 ${XCXX} -c -p ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
167 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
168 @mv ${.TARGET}.tmp ${.TARGET}
170 ${NEW2POBJS}: new2.cc
171 ${CXX} -c -p ${CXXFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.cc}
172 @${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
173 @mv ${.TARGET}.tmp ${.TARGET}
176 .include <bsd.lib.mk>