1*0a6a1f1dSLionel Sambuc# $NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 mrg Exp $ 218a5822eSThomas Veerman 318a5822eSThomas VeermanREQUIRETOOLS= yes 418a5822eSThomas VeermanNOLINT= # defined 518a5822eSThomas VeermanUNSUPPORTED_COMPILER.clang= # defined 618a5822eSThomas Veerman 7*0a6a1f1dSLionel Sambuc.include <bsd.init.mk> 818a5822eSThomas Veerman 918a5822eSThomas Veerman# If using an external toolchain, we expect crtbegin/crtend to be 1018a5822eSThomas Veerman# supplied by that toolchain's run-time support. 1118a5822eSThomas Veerman.if !defined(EXTERNAL_TOOLCHAIN) && ${MKGCC} != "no" 1218a5822eSThomas Veerman 13*0a6a1f1dSLionel SambucDIST= ${GCCDIST} 1418a5822eSThomas VeermanGNUHOSTDIST= ${DIST} 15*0a6a1f1dSLionel SambucGCCARCH= ${EXTERNAL_GCC_SUBDIR}/usr.bin/gcc/arch/${MACHINE_ARCH} 1618a5822eSThomas Veerman 1718a5822eSThomas VeermanGALLCFLAGS= ${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS} 1818a5822eSThomas Veerman 1918a5822eSThomas VeermanCPPFLAGS+= -I${GCCARCH} ${GALLCFLAGS:M-D*} ${GALLCFLAGS:M-I*:N-I.*} 20*0a6a1f1dSLionel SambucCPPFLAGS+= -I. -I${DIST}/libgcc -I${DIST}/gcc -I${DIST}/include 21*0a6a1f1dSLionel SambucCPPFLAGS+= -DIN_GCC 2218a5822eSThomas VeermanCOPTS+= -finhibit-size-directive \ 2318a5822eSThomas Veerman -fno-inline \ 2418a5822eSThomas Veerman -fno-exceptions \ 2518a5822eSThomas Veerman -fno-zero-initialized-in-bss \ 2618a5822eSThomas Veerman -fno-toplevel-reorder \ 2718a5822eSThomas Veerman -fno-tree-vectorize \ 2818a5822eSThomas Veerman -fno-omit-frame-pointer \ 2918a5822eSThomas Veerman -fno-asynchronous-unwind-tables 3018a5822eSThomas Veerman 3118a5822eSThomas VeermanGCFLAGS= ${GALLCFLAGS:N-D*:N-I*:N-i*:N./*} 3218a5822eSThomas Veerman 3318a5822eSThomas VeermanDPSRCS+= ${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h 3418a5822eSThomas Veerman 3518a5822eSThomas Veerman.include "${.CURDIR}/arch/${MACHINE_ARCH}.mk" 3618a5822eSThomas Veerman 3718a5822eSThomas VeermanSRCS+= crtbegin.c crtend.c 3818a5822eSThomas VeermanOBJS+= crtbegin.o crtend.o 3918a5822eSThomas Veerman.if ${MKPIC} != "no" 4018a5822eSThomas VeermanSRCS+= crtbeginS.c crtendS.c 4118a5822eSThomas VeermanOBJS+= crtbeginS.o crtendS.o # for shared libraries 4218a5822eSThomas VeermanCPPFLAGS.crtbeginS.o+= -fPIC -DPIC 4318a5822eSThomas VeermanCPPFLAGS.crtendS.o+= -fPIC -DPIC 4418a5822eSThomas VeermanSRCS+= crtbeginT.c 4518a5822eSThomas VeermanOBJS+= crtbeginT.o # for -static links 4618a5822eSThomas Veerman.endif 4718a5822eSThomas Veerman 4818a5822eSThomas Veermanrealall: ${OBJS} 4918a5822eSThomas Veerman 5018a5822eSThomas VeermanFILES=${OBJS} 5118a5822eSThomas VeermanFILESDIR=${LIBDIR} 5218a5822eSThomas Veerman 53*0a6a1f1dSLionel Sambuc.PATH: ${DIST}/libgcc ${DIST}/libgcc/config 5418a5822eSThomas Veerman 5518a5822eSThomas Veerman.include "../Makefile.tconfigh" 56*0a6a1f1dSLionel SambucEXTRA_FAKEHEADERS= options.h libgcc_tm.h 5718a5822eSThomas Veerman.include "../Makefile.hacks" 5818a5822eSThomas Veerman 5918a5822eSThomas Veerman${OBJS}: ${DPSRCS} 6018a5822eSThomas Veerman 6118a5822eSThomas Veerman.include <bsd.prog.mk> 6218a5822eSThomas Veerman 6318a5822eSThomas Veerman# Override the default .c -> .o rule. 6418a5822eSThomas Veerman.c.o: 6518a5822eSThomas Veerman ${_MKTARGET_COMPILE} 6618a5822eSThomas Veerman ${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o 6718a5822eSThomas Veerman mv ${.TARGET}.o ${.TARGET} 6818a5822eSThomas Veerman 6918a5822eSThomas Veerman.if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el") 7018a5822eSThomas Veerman# Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0 7118a5822eSThomas Veerman# and GCC configury passes -finhibit-size-directive which causes mips-gas 7218a5822eSThomas Veerman# to barf. Don't know what the real fix for this is... 7318a5822eSThomas Veerman# 7418a5822eSThomas Veerman# XXX should be COPTS, but that's too early 7518a5822eSThomas VeermanCPUFLAGS+=-Wa,--no-warn 7618a5822eSThomas Veerman.endif 7718a5822eSThomas Veerman 7818a5822eSThomas Veerman.else 7918a5822eSThomas Veerman 8018a5822eSThomas Veerman.include <bsd.prog.mk> # do nothing 8118a5822eSThomas Veerman 8218a5822eSThomas Veerman.endif # ! EXTERNAL_TOOLCHAIN && MKGCC != no 83