Remove building with NOCRYPTO option
[minix.git] / external / gpl3 / gcc / lib / libgcc / Makefile.inc
blob18614188e85a3f341541d052d29c29973de495e1
1 #       $NetBSD: Makefile.inc,v 1.30 2015/04/15 19:13:46 mrg Exp $
3 LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/}
5 .if ${MKGCC} != "no"
6 .if exists(${.CURDIR}/../arch/${LIBGCC_MACHINE_ARCH}/defs.mk)
7 .include "${.CURDIR}/../arch/${LIBGCC_MACHINE_ARCH}/defs.mk"
8 .endif
9 .endif
11 UNSUPPORTED_COMPILER.clang=     # defined
13 DIST=           ${GCCDIST}
14 GNUHOSTDIST=    ${DIST}
15 GCCARCH=        ${GCC_SUBDIR}/usr.bin/gcc/arch/${LIBGCC_MACHINE_ARCH}
16 GCCARCHLIBGCC=  ${GCC_SUBDIR}/lib/libgcc/arch/${LIBGCC_MACHINE_ARCH}
17 GCCARCHXX=      ${GCC_SUBDIR}/lib/libstdc++-v3/arch/${LIBGCC_MACHINE_ARCH}
19 GCPPFLAGS=      ${G_LIBGCC2_CFLAGS} ${G_USE_COLLECT2} ${G_INCLUDES}
20 CPPFLAGS+=      -I${.CURDIR} -I${GCCARCHLIBGCC}
21 CPPFLAGS+=      -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
22 CPPFLAGS+=      ${GCPPFLAGS:M-m*} ${GCPPFLAGS:M-f*}
23 CPPFLAGS+=      ${G_EXTRA_HEADERS:M/*:H:u:S/^/-I/g}
24 CPPFLAGS+=      -I${DIST}/libgcc -I${DIST}/libgcc/config
25 CPPFLAGS+=      -I${DIST}/gcc -I${DIST}/include -I.
27 .if ${LIBGCC_MACHINE_ARCH} == "powerpc" || \
28     ${LIBGCC_MACHINE_ARCH} == "sh3el" || \
29     ${LIBGCC_MACHINE_ARCH} == "sh3eb" || \
30     ${LIBGCC_MACHINE_ARCH} == "m68000"
31 _TRADITIONAL_CPP=
32 COMPILE.S=      ${CC} ${AFLAGS} ${CPPFLAGS} -c
33 .endif
35 .if ${LIBGCC_MACHINE_ARCH} == "powerpc"
36 CPPFLAGS+=      -I${DIST}/gcc/config/rs6000
37 .endif
40 # Old style libgcc build procedure.
43 # This is copied from dist/libgcc/Makefile.in:$lib2funcs
44 LIB2FUNCS_ALL= \
45         _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2    \
46         _clear_cache _trampoline __main \
47         _absvsi2 _absvdi2 _addvsi3 _addvdi3 \
48         _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \
49         _negvsi2 _negvdi2 \
50         _ctors \
51         _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2  _ctzsi2 _ctzdi2 \
52         _popcount_tab _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 \
53         _powisf2 _powidf2 _powixf2 _powitf2 \
54         _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3 _divtc3 \
55         _bswapsi2 _bswapdi2 _clrsbsi2 _clrsbdi2
57 .if ${LIBGCC_MACHINE_ARCH} != "coldfire" && empty(LIBGCC_MACHINE_ARCH:Mearm*)
59 LIB2FUNCS_ALL+= \
60         _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
62 .endif
64 .if ${LIBGCC_MACHINE_ARCH} != "coldfire" && empty(LIBGCC_MACHINE_ARCH:Mearm*)
66 # non swfloat versions 
67 .for _p in _fix _fixuns
68 . for _m in sf df xf tf
69 LIB2FUNCS_ALL+= ${_p}${_m}di
70 . endfor
71 .endfor
73 .for _p in _float _floatun
74 . for _m in sf df xf tf
75 LIB2FUNCS_ALL+= ${_p}di${_m}
76 . endfor
77 .endfor
79 .for _m in sf df xf
80 LIB2FUNCS_ALL+= _fixuns${_m}si
81 .endfor
82 .endif
84 LIB2FUNCS_SHORT:=${LIB2FUNCS_ALL}
85 LIB2_DIVMOD_FUNCS:=${G_LIB2_DIVMOD_FUNCS}
86 .for f in ${G_LIB1ASMFUNCS}; do
87 LIB2FUNCS_SHORT:=${LIB2FUNCS_SHORT:N${f}}
88 LIB2_DIVMOD_FUNCS:=${LIB2_DIVMOD_FUNCS:N${f}}
89 .endfor
91 LIB2FUNCS=      ${LIB2FUNCS_SHORT:=.c}
92 LIB2FUNCS_ST=   ${G_LIB2FUNCS_ST:=.c}
93 LIB2DIVMOD=     ${LIB2_DIVMOD_FUNCS:=.c}
94 .if ${HAVE_LIBGCC_EH} == "no"
95 LIB2_EH=        ${G_LIB2ADDEH:M*.c:T:Nunwind-dw2.c:Nunwind-dw2-fde-dip.c:Nunwind-sjlj.c:Nunwind-c.c:Nunwind-arm.c:Npr-support.c}
96 LIB2_EHASM=     ${G_LIB2ADDEH:M*.S:T:Nlibunwind.S}
97 G_CONFIGLINKS:= ${G_CONFIGLINKS:S,libgcc/config/arm/unwind-arm.h,libgcc/unwind-generic.h,}
98 .else
99 LIB2_EH=        ${G_LIB2ADDEH:M*.c:T}
100 LIB2_EHASM=     ${G_LIB2ADDEH:M*.S:T}
101 .endif
103 # We have to weed out any existing func.S file that may exist
104 # from the list of files we create.
105 .if !empty(G_LIB1ASMFUNCS)
106 . for f in ${G_LIB1ASMFUNCS:=.S}
107 .  if !exists(${DIST}/libgcc/config/${MACHINE_GNU_ARCH}/${f})
108 LIB1ASMFUNCS+=  ${f}
109 .  endif
110 . endfor
111 .endif
113 .if exists(${.CURDIR}/../arch/${LIBGCC_MACHINE_ARCH}/defs.mk)
114 DPSRCS+=        ${.CURDIR}/../arch/${LIBGCC_MACHINE_ARCH}/defs.mk
115 .endif
116 CLEANFILES+=    ${LIB2FUNCS} ${LIB2FUNCS_ST} ${LIB2DIVMOD} cs-tconfig.h
117 .if !empty(G_LIB1ASMFUNCS)
118 CLEANFILES+=    ${LIB1ASMFUNCS}
119 .endif
121 .for file in ${G_LIB2ADD:M${GNUHOSTDIST}*:N*.c}
122 BUILDSYMLINKS+= ${file} ${file:T:S/.asm$/.S/}
123 .endfor
125 # XXX
126 .if (${LIBGCC_MACHINE_ARCH} == "m68000" || ${LIBGCC_MACHINE_ARCH} == "m68k" || \
127      ${LIBGCC_MACHINE_ARCH} == "coldfire")
128 CPICFLAGS:=
129 BUILDSYMLINKS+= ${DIST}/libgcc/config/m68k/fpgnulib.c fpgnulib.c
130 BUILDSYMLINKS+= ${DIST}/libgcc/config/m68k/fpgnulib.c xfgnulib.c
131 CPPFLAGS.xfgnulib.c+=   -DEXTFLOAT=1
132 .endif
134 .if ${LIBGCC_MACHINE_ARCH} == "powerpc64"
135 COPTS+= -mlong-double-128
136 .endif
138 ${LIB2FUNCS} ${LIB2FUNCS_ST}: ${.CURDIR}/Makefile
139         ${_MKTARGET_CREATE}
140         printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
142 ${LIB2DIVMOD}: ${.CURDIR}/Makefile
143         ${_MKTARGET_CREATE}
144         printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
146 .if !empty(G_LIB1ASMFUNCS)
147 ${LIB1ASMFUNCS}: ${.CURDIR}/Makefile
148         ${_MKTARGET_CREATE}
149         printf '#define L${.PREFIX}\n#include <${G_LIB1ASMSRC}>\n' >${.TARGET}
150 .endif
152 # Use dynamic sources to arrange for the C file to be the first dependency
153 # so ${.IMPSRC} will work.
155 ${LIB2_EH:.c=.o}: $(.PREFIX).c
156         ${_MKTARGET_COMPILE}
157         ${COMPILE.c} -fexceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
159 ${LIB2_EH:.c=.pico}: $(.PREFIX).c
160         ${_MKTARGET_COMPILE}
161         ${COMPILE.c} ${CPICFLAGS} -fexceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
163 ${G_LIB2_DIVMOD_FUNCS:=.o}: $(.PREFIX).c
164         ${_MKTARGET_COMPILE}
165         ${COMPILE.c} -fexceptions -fnon-call-exceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
167 ${G_LIB2_DIVMOD_FUNCS:=.pico}: $(.PREFIX).c
168         ${_MKTARGET_COMPILE}
169         ${COMPILE.c} ${CPICFLAGS} -fexceptions -fnon-call-exceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
171 dp-bit.c: ${.CURDIR}/Makefile
172         ${_MKTARGET_CREATE}
173         printf '#define FLOAT\n#include <fp-bit.c>\n' >${.TARGET}
176 # Common rules.
179 .PATH: ${DIST}/gcc ${DIST}/gcc/cp ${DIST}/gcc/cp/inc ${DIST}/gcc/config \
180         ${G_LIB2ADD:H:O:u} ${G_LIB2ADDEH:H:O:u} ${GCCARCHLIBGCC}
182 .include "../Makefile.tconfigh"
183 DPSRCS+=        tconfig.h
185 .if ${MKGCC} != "no"
186 .if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS)
187 BUILDSYMLINKS+= ${G_CONFIGLINKS}
188 .for _src _dst in ${G_CONFIGLINKS}
189 DPSRCS+=        ${_dst}
190 .endfor
191 .endif
192 .endif
194 EXTRA_FAKEHEADERS=      options.h libgcc_tm.h
195 .include "../../Makefile.hacks"