1 # $NetBSD: Makefile,v 1.3 2008/08/04 04:53:22 lukem Exp $
8 # If using an external toolchain, we expect crtbegin/crtend to be
9 # supplied by that toolchain's run-time support.
10 .if
!defined
(EXTERNAL_TOOLCHAIN
) && ${MKGCC} != "no" && ${OBJECT_FMT} == "ELF"
12 DIST
= ${NETBSDSRCDIR}/gnu
/dist/gcc4
14 GCCARCH
= ${NETBSDSRCDIR}/gnu
/usr.bin
/gcc4
/arch
/${MACHINE_ARCH}
16 GALLCFLAGS
= ${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS}
18 CPPFLAGS
+= -I
${GCCARCH} ${GALLCFLAGS
:M-D
*} ${GALLCFLAGS
:M-I
*:N-I.
*}
21 GCFLAGS
= ${GALLCFLAGS
:N-D
*:N-I
*:N-i
*:N.
/*}
23 DPSRCS
+= ${.CURDIR
}/arch
/${MACHINE_ARCH}.mk tconfig.h
24 CLEANFILES
+= cs-tconfig.h tconfig.h
26 .
include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
28 SRCS
+= crtbegin.c crtend.c
29 OBJS
+= crtbegin.o crtend.o
31 SRCS
+= crtbeginS.c crtendS.c
32 OBJS
+= crtbeginS.o crtendS.o
# for shared libraries
34 OBJS
+= crtbeginT.o
# for -static links
42 .PATH
: ${DIST}/gcc
${DIST}/gcc
/config
${G_CONFIGDIR}
46 TM_DEFINES
="$(G_tm_defines)" \
47 HEADERS
="$(G_xm_file)" XM_DEFINES
="$(G_xm_defines)" \
48 TARGET_CPU_DEFAULT
="" \
49 ${HOST_SH} $(GNUHOSTDIST
)/gcc
/mkconfig.sh tconfig.h
51 # these aren't necessary but are #include'd
52 FAKEHEADERS
=options.h insn-flags.h insn-constants.h
56 DPSRCS
+= ${FAKEHEADERS}
57 CLEANFILES
+= ${FAKEHEADERS}
61 .
include <bsd.prog.mk
>
63 # Override the default .c -> .o rule.
66 ${CC} ${CPPFLAGS} ${GCFLAGS} ${CPUFLAGS} -c
${.IMPSRC
} -o
${.TARGET
}.o
67 mv
${.TARGET
}.o
${.TARGET
}
69 .if
(${MACHINE_ARCH} == "mips64eb") ||
(${MACHINE_ARCH} == "mips64el")
70 # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
71 # and GCC configury passes -finhibit-size-directive which causes mips-gas
72 # to barf. Don't know what the real fix for this is...
74 # XXX should be COPTS, but that's too early
75 CPUFLAGS
+=-Wa
,--no-warn
80 .
include <bsd.prog.mk
> # do nothing
82 .
endif # ! EXTERNAL_TOOLCHAIN && MKGCC != no && OBJECT_FMT == ELF