Makefile revision 1.13
1# $NetBSD: Makefile,v 1.13 2016/03/23 05:28:01 mrg Exp $ 2 3USE_SHLIBDIR= yes 4REQUIRETOOLS= yes 5NOLINT= # defined 6 7LIB= gcc_s 8NOSTATICLIB= # defined 9NOPROFILE= # defined 10NOPICINSTALL= # defined 11 12.include "../../../Makefile.gcc_path" 13.include <bsd.own.mk> 14 15.if ${MKGCC} != "no" 16 17.cc: # disable .cc->NULL transform 18 19SHLIB_MAJOR= 1 20SHLIB_MINOR= 0 21 22LDFLAGS+= -nodefaultlibs 23LDFLAGS+= -Wl,--version-script=${.OBJDIR}/libgcc.map 24 25# XXX handle this better? GCC 4.8 moved them. 26.if ${MACHINE} == "emips" 27LIB2ADD_HACK+= ${GNUHOSTDIST}/gcc/config/floatunsidf.c \ 28 ${GNUHOSTDIST}/gcc/config/floatunsisf.c 29.endif 30 31# XXXGCC5 GCC 5.3 has all these in libgcc and we have them in libc. 32.if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb" 33LIB2ADD_EDITED= ${G_LIB2ADD:T:Nfloatsisf.c:Nfloatunsisf.c:Nfloatsidf.c:Nfloatunsidf.c:Nfixsfsi.c:Nextendsfdf2.c:Naddsf3.c:Nmulsf3.c:Ndivsf3.c:Nadddf3.c:Nsubdf3.c:Nmuldf3.c:Ndivdf3.c:Nfixdfsi.c:S/.asm/.S/} 34.else 35LIB2ADD_EDITED= ${G_LIB2ADD:T:S/.asm/.S/} 36.endif 37 38SRCS+= ${LIB2FUNCS} ${LIB2DIVMOD} ${LIB2_EH} ${LIB2_EHASM} \ 39 ${LIB2ADD_EDITED} \ 40 ${LIB2ADD_HACK:T:S/.asm/.S/} \ 41 ${G_LIB2ADD_ST:T} ${LIB1ASMFUNCS} 42 43COPTS.unwind-dw2.c = -Wno-stack-protector 44 45DPADD+= libgcc.map 46CLEANFILES+= libgcc.map 47 48.include <bsd.lib.mk> 49 50.if ${MKPICLIB} != "no" 51LIBGCC_S_OBJS= ${SOBJS} 52.else 53LIBGCC_S_OBJS= ${OBJS} 54.endif 55 56LIBGCC_STD_VER_IN= ${GNUHOSTDIST}/libgcc/libgcc-std.ver.in 57CLEANFILES+= libgcc-std.ver 58 59libgcc-std.ver: ${LIBGCC_STD_VER_IN} 60 ${_MKTARGET_CREATE} 61 ${TOOL_SED} -e 's/__PFX__/__/g' -e 's/__FIXPTPFX__/__/g' < ${LIBGCC_STD_VER_IN} > ${.TARGET}.tmp 62 mv ${.TARGET}.tmp ${.TARGET} 63 64libgcc.map: ${LIBGCC_S_OBJS} ${G_SHLIB_MKMAP} ${G_SHLIB_MAPFILES} 65 { \ 66 ${NM} ${G_SHLIB_NM_FLAGS} ${LIBGCC_S_OBJS}; \ 67 echo %%; \ 68 for f in ${G_SHLIB_MAPFILES}; do \ 69 if [ -f ${.OBJDIR}/$${f} ]; then \ 70 cat ${.OBJDIR}/$${f}; \ 71 else \ 72 cat $${f}; \ 73 fi; \ 74 done | \ 75 ${TOOL_SED} -e "/^[ ]*#/d" \ 76 -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' | \ 77 ${CC} ${G_LIBGCC2_CFLAGS} ${G_INCLUDES} -E -xassembler-with-cpp -; \ 78 } | ${TOOL_AWK} -f ${G_SHLIB_MKMAP} > ${.TARGET}.tmp 79 mv ${.TARGET}.tmp ${.TARGET} 80 81.else 82.include <bsd.prog.mk> # do nothing 83.endif 84