Expand PMF_FN_* macros.
[netbsd-mini2440.git] / gnu / lib / libgcc4 / Makefile.inc
blob7a50801f749c4bbe4b6ed9954f752ee7a1518227
1 #       $NetBSD$
3 .if ${MKGCC} != "no"
4 .if exists(${.CURDIR}/../arch/${MACHINE_ARCH}.mk)
5 .include "${.CURDIR}/../arch/${MACHINE_ARCH}.mk"
6 .endif
7 .endif
9 DIST=           ${NETBSDSRCDIR}/gnu/dist/gcc4
10 GNUHOSTDIST=    ${DIST}
11 GCCARCH=        ${NETBSDSRCDIR}/gnu/usr.bin/gcc4/arch/${MACHINE_ARCH}
12 GCCARCHLIBGCC=  ${NETBSDSRCDIR}/gnu/lib/libgcc4/arch/${MACHINE_ARCH}
13 GCCARCHXX=      ${NETBSDSRCDIR}/gnu/lib/libstdc++-v3_4/arch/${MACHINE_ARCH}
15 GCPPFLAGS=      ${G_LIBGCC2_CFLAGS} ${G_USE_COLLECT2} ${G_INCLUDES}
16 CPPFLAGS+=      -I${.CURDIR} -I${GCCARCHLIBGCC}
17 CPPFLAGS+=      -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
18 CPPFLAGS+=      -I${G_EXTRA_HEADERS:M/*:H:u}
19 CPPFLAGS+=      -I${DIST} -I${DIST}/gcc/cp -I${DIST}/gcc/config -I${GCCARCHXX} -I.
21 .if ${MACHINE_ARCH} == "powerpc" || \
22     ${MACHINE_ARCH} == "sh3el" || \
23     ${MACHINE_ARCH} == "sh3eb" || \
24     ${MACHINE_ARCH} == "m68000"
25 _TRADITIONAL_CPP=
26 COMPILE.S=      ${CC} ${AFLAGS} ${CPPFLAGS} -c
27 .endif
29 .if !defined(MKNATIVE_LIBGCC_NEW)
32 # Old style libgcc build procedure.
35 # This is copied from gcc/mklibgcc.in:$lib2funcs
36 LIB2FUNCS_ALL=  _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \
37         _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi \
38         _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi \
39         _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache \
40         _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3 \
41         _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors \
42         _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab \
43         _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \
44         _powixf2 _powitf2 \
46 LIB2FUNCS_ALL+= \
47         _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3 _divtc3
49 LIB2FUNCS_SHORT:=${LIB2FUNCS_ALL}
50 LIB2_DIVMOD_FUNCS:=${G_LIB2_DIVMOD_FUNCS}
51 .for f in ${G_LIB1ASMFUNCS}; do
52 LIB2FUNCS_SHORT:=${LIB2FUNCS_SHORT:N${f}}
53 LIB2_DIVMOD_FUNCS:=${LIB2_DIVMOD_FUNCS:N${f}}
54 .endfor
56 LIB2FUNCS=      ${LIB2FUNCS_SHORT:=.c}
57 LIB2FUNCS_ST=   ${G_LIB2FUNCS_ST:=.c}
58 LIB2DIVMOD=     ${LIB2_DIVMOD_FUNCS:=.c}
59 LIB2_EH=        ${G_LIB2ADDEH:M*.c:T}
60 .if !empty(G_LIB1ASMFUNCS)
61 LIB1ASMFUNCS=   ${G_LIB1ASMFUNCS:=.S}
62 .endif
64 DPSRCS+=        ${.CURDIR}/../arch/${MACHINE_ARCH}.mk
65 CLEANFILES+=    ${LIB2FUNCS} ${LIB2FUNCS_ST} ${LIB2DIVMOD} cs-tconfig.h
66 .if !empty(G_LIB1ASMFUNCS)
67 CLEANFILES+=    ${LIB1ASMFUNCS}
68 .endif
70 .for file in ${G_LIB2ADD:M${GNUHOSTDIST}*}
71 BUILDSYMLINKS+= ${file} ${file:T:S/.asm$/.S/}
72 .endfor
74 # XXX
75 .if ${MACHINE_ARCH} == "m68000"
76 CPICFLAGS:=
77 BUILDSYMLINKS+= ${DIST}/gcc/config/m68k/fpgnulib.c fpgnulib.c
78 BUILDSYMLINKS+= ${DIST}/gcc/config/m68k/fpgnulib.c xfgnulib.c
79 CPPFLAGS.xfgnulib.c+=-DEXTFLOAT=1
80 .endif
82 .if ${MACHINE_ARCH} == "powerpc64"
83 COPTS+= -mlong-double-128
84 .endif
86 ${LIB2FUNCS} ${LIB2FUNCS_ST}: ${.CURDIR}/Makefile
87         ${_MKTARGET_CREATE}
88         printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
90 ${LIB2DIVMOD}: ${.CURDIR}/Makefile
91         ${_MKTARGET_CREATE}
92         printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
94 .if !empty(G_LIB1ASMFUNCS)
95 ${LIB1ASMFUNCS}: ${.CURDIR}/Makefile
96         ${_MKTARGET_CREATE}
97         printf '#define L${.PREFIX}\n#include <${G_LIB1ASMSRC}>\n' >${.TARGET}
98 .endif
100 ${LIB2_EH:.c=.o}:
101         ${_MKTARGET_COMPILE}
102         ${COMPILE.c} -fexceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
104 ${LIB2_EH:.c=.so}:
105         ${_MKTARGET_COMPILE}
106         ${COMPILE.c} ${CPICFLAGS} -fexceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
108 ${G_LIB2_DIVMOD_FUNCS:=.o}:
109         ${_MKTARGET_COMPILE}
110         ${COMPILE.c} -fexceptions -fnon-call-exceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
112 ${G_LIB2_DIVMOD_FUNCS:=.so}:
113         ${_MKTARGET_COMPILE}
114         ${COMPILE.c} ${CPICFLAGS} -fexceptions -fnon-call-exceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
116 dp-bit.c: ${.CURDIR}/Makefile
117         ${_MKTARGET_CREATE}
118         printf '#define FLOAT\n#include <fp-bit.c>\n' >${.TARGET}
120 .else   # defined(MKNATIVE_LIBGCC_NEW)
123 # New style libgcc build procedure.
126 .endif  # defined(MKNATIVE_LIBGCC_NEW)
129 # Common rules.
132 .PATH: ${DIST}/gcc ${DIST}/gcc/cp ${DIST}/gcc/cp/inc ${DIST}/gcc/config \
133         ${G_CONFIGDIR}
135 tconfig.h:
136         ${_MKTARGET_CREATE}
137         TARGET_CPU_DEFAULT="" \
138         HEADERS="$(G_xm_include_list)" DEFINES="USED_FOR_TARGET $(G_xm_defines)" \
139         ${HOST_SH} $(GNUHOSTDIST)/gcc/mkconfig.sh tconfig.h
140 DPSRCS+=        tconfig.h
141 CLEANFILES+=    tconfig.h
143 BUILDSYMLINKS+= ${G_UNWIND_H} unwind.h
144 DPSRCS+=        unwind.h
146 # these aren't necessary but are #include'd
147 FAKEHEADERS=options.h insn-flags.h insn-constants.h
148 ${FAKEHEADERS}:
149         ${_MKTARGET_CREATE}
150         touch ${.TARGET}
151 DPSRCS+=        ${FAKEHEADERS}
152 CLEANFILES+=    ${FAKEHEADERS}