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