1 # $NetBSD: Makefile,v 1.7 2012/02/28 20:26:07 joerg Exp $
5 UNSUPPORTED_COMPILER.clang
= # defined
9 # If using an external toolchain, we expect crtbegin/crtend to be
10 # supplied by that toolchain's run-time support.
11 .if
!defined
(EXTERNAL_TOOLCHAIN
) && ${MKGCC} != "no"
13 DIST
= ${NETBSDSRCDIR}/external
/gpl3
/gcc
/dist
15 GCCARCH
= ${NETBSDSRCDIR}/external
/gpl3
/gcc
/usr.bin
/gcc
/arch
/${MACHINE_ARCH}
17 GALLCFLAGS
= ${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS}
19 CPPFLAGS
+= -I
${GCCARCH} ${GALLCFLAGS
:M-D
*} ${GALLCFLAGS
:M-I
*:N-I.
*}
21 COPTS
+= -finhibit-size-directive \
24 -fno-zero-initialized-in-bss \
25 -fno-toplevel-reorder \
27 -fno-omit-frame-pointer \
28 -fno-asynchronous-unwind-tables
30 GCFLAGS
= ${GALLCFLAGS
:N-D
*:N-I
*:N-i
*:N.
/*}
32 DPSRCS
+= ${.CURDIR
}/arch
/${MACHINE_ARCH}.mk tconfig.h
34 .
include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
36 SRCS
+= crtbegin.c crtend.c
37 OBJS
+= crtbegin.o crtend.o
39 SRCS
+= crtbeginS.c crtendS.c
40 OBJS
+= crtbeginS.o crtendS.o
# for shared libraries
41 CPPFLAGS.crtbeginS.o
+= -fPIC
-DPIC
42 CPPFLAGS.crtendS.o
+= -fPIC
-DPIC
44 OBJS
+= crtbeginT.o
# for -static links
52 .PATH
: ${DIST}/gcc
${DIST}/gcc
/config
${G_CONFIGDIR}
54 .
include "../Makefile.tconfigh"
55 EXTRA_FAKEHEADERS
= options.h
56 .
include "../Makefile.hacks"
60 .
include <bsd.prog.mk
>
62 # Override the default .c -> .o rule.
65 ${CC} ${CPPFLAGS} ${CPPFLAGS.
${.TARGET
}} ${GCFLAGS} ${COPTS} ${COPTS.
${.TARGET
}} ${CPUFLAGS} -c
${.IMPSRC
} -o
${.TARGET
}.o
66 mv
${.TARGET
}.o
${.TARGET
}
68 .if
(${MACHINE_ARCH} == "mips64eb") ||
(${MACHINE_ARCH} == "mips64el")
69 # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
70 # and GCC configury passes -finhibit-size-directive which causes mips-gas
71 # to barf. Don't know what the real fix for this is...
73 # XXX should be COPTS, but that's too early
74 CPUFLAGS
+=-Wa
,--no-warn
79 .
include <bsd.prog.mk
> # do nothing
81 .
endif # ! EXTERNAL_TOOLCHAIN && MKGCC != no