1 1.15 christos # $NetBSD: Makefile,v 1.15 2021/04/25 23:12:54 christos Exp $ 2 1.1 mrg 3 1.1 mrg REQUIRETOOLS= yes 4 1.1 mrg NOLINT= # defined 5 1.7 joerg UNSUPPORTED_COMPILER.clang= # defined 6 1.1 mrg 7 1.13 mrg .include <bsd.init.mk> 8 1.1 mrg 9 1.1 mrg # If using an external toolchain, we expect crtbegin/crtend to be 10 1.1 mrg # supplied by that toolchain's run-time support. 11 1.1 mrg .if !defined(EXTERNAL_TOOLCHAIN) && ${MKGCC} != "no" 12 1.1 mrg 13 1.13 mrg DIST= ${GCCDIST} 14 1.1 mrg GNUHOSTDIST= ${DIST} 15 1.14 mrg GCCARCH= ${.CURDIR}/../../usr.bin/gcc/arch/${MACHINE_ARCH} 16 1.1 mrg 17 1.1 mrg GALLCFLAGS= ${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS} 18 1.1 mrg 19 1.1 mrg CPPFLAGS+= -I${GCCARCH} ${GALLCFLAGS:M-D*} ${GALLCFLAGS:M-I*:N-I.*} 20 1.12 mrg CPPFLAGS+= -I. -I${DIST}/libgcc -I${DIST}/gcc -I${DIST}/include 21 1.12 mrg CPPFLAGS+= -DIN_GCC 22 1.3 mrg COPTS+= -finhibit-size-directive \ 23 1.3 mrg -fno-inline \ 24 1.3 mrg -fno-exceptions \ 25 1.3 mrg -fno-zero-initialized-in-bss \ 26 1.3 mrg -fno-toplevel-reorder \ 27 1.3 mrg -fno-tree-vectorize \ 28 1.3 mrg -fno-omit-frame-pointer \ 29 1.3 mrg -fno-asynchronous-unwind-tables 30 1.1 mrg 31 1.1 mrg GCFLAGS= ${GALLCFLAGS:N-D*:N-I*:N-i*:N./*} 32 1.1 mrg 33 1.1 mrg DPSRCS+= ${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h 34 1.1 mrg 35 1.1 mrg .include "${.CURDIR}/arch/${MACHINE_ARCH}.mk" 36 1.1 mrg 37 1.1 mrg SRCS+= crtbegin.c crtend.c 38 1.1 mrg OBJS+= crtbegin.o crtend.o 39 1.1 mrg .if ${MKPIC} != "no" 40 1.1 mrg SRCS+= crtbeginS.c crtendS.c 41 1.1 mrg OBJS+= crtbeginS.o crtendS.o # for shared libraries 42 1.3 mrg CPPFLAGS.crtbeginS.o+= -fPIC -DPIC 43 1.3 mrg CPPFLAGS.crtendS.o+= -fPIC -DPIC 44 1.1 mrg SRCS+= crtbeginT.c 45 1.1 mrg OBJS+= crtbeginT.o # for -static links 46 1.1 mrg .endif 47 1.1 mrg 48 1.1 mrg realall: ${OBJS} 49 1.1 mrg 50 1.1 mrg FILES=${OBJS} 51 1.1 mrg FILESDIR=${LIBDIR} 52 1.1 mrg 53 1.12 mrg .PATH: ${DIST}/libgcc ${DIST}/libgcc/config 54 1.1 mrg 55 1.3 mrg .include "../Makefile.tconfigh" 56 1.11 mrg EXTRA_FAKEHEADERS= options.h libgcc_tm.h 57 1.4 mrg .include "../Makefile.hacks" 58 1.1 mrg 59 1.1 mrg ${OBJS}: ${DPSRCS} 60 1.1 mrg 61 1.1 mrg .include <bsd.prog.mk> 62 1.1 mrg 63 1.1 mrg # Override the default .c -> .o rule. 64 1.1 mrg .c.o: 65 1.1 mrg ${_MKTARGET_COMPILE} 66 1.6 macallan ${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o 67 1.1 mrg mv ${.TARGET}.o ${.TARGET} 68 1.1 mrg 69 1.15 christos .if ${MACHINE_MIPS64} 70 1.1 mrg # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0 71 1.1 mrg # and GCC configury passes -finhibit-size-directive which causes mips-gas 72 1.1 mrg # to barf. Don't know what the real fix for this is... 73 1.1 mrg # 74 1.1 mrg # XXX should be COPTS, but that's too early 75 1.1 mrg CPUFLAGS+=-Wa,--no-warn 76 1.1 mrg .endif 77 1.1 mrg 78 1.1 mrg .else 79 1.1 mrg 80 1.1 mrg .include <bsd.prog.mk> # do nothing 81 1.1 mrg 82 1.1 mrg .endif # ! EXTERNAL_TOOLCHAIN && MKGCC != no 83