etc/protocols - sync with NetBSD-8
[minix.git] / external / gpl3 / gcc / lib / crtstuff / Makefile
blob254f741e28b373d5cbbdeba68b92c6bbf9f4bc0f
1 # $NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 mrg Exp $
3 REQUIRETOOLS= yes
4 NOLINT= # defined
5 UNSUPPORTED_COMPILER.clang= # defined
7 .include <bsd.init.mk>
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= ${GCCDIST}
14 GNUHOSTDIST= ${DIST}
15 GCCARCH= ${EXTERNAL_GCC_SUBDIR}/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.*}
20 CPPFLAGS+= -I. -I${DIST}/libgcc -I${DIST}/gcc -I${DIST}/include
21 CPPFLAGS+= -DIN_GCC
22 COPTS+= -finhibit-size-directive \
23 -fno-inline \
24 -fno-exceptions \
25 -fno-zero-initialized-in-bss \
26 -fno-toplevel-reorder \
27 -fno-tree-vectorize \
28 -fno-omit-frame-pointer \
29 -fno-asynchronous-unwind-tables
31 GCFLAGS= ${GALLCFLAGS:N-D*:N-I*:N-i*:N./*}
33 DPSRCS+= ${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h
35 .include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
37 SRCS+= crtbegin.c crtend.c
38 OBJS+= crtbegin.o crtend.o
39 .if ${MKPIC} != "no"
40 SRCS+= crtbeginS.c crtendS.c
41 OBJS+= crtbeginS.o crtendS.o # for shared libraries
42 CPPFLAGS.crtbeginS.o+= -fPIC -DPIC
43 CPPFLAGS.crtendS.o+= -fPIC -DPIC
44 SRCS+= crtbeginT.c
45 OBJS+= crtbeginT.o # for -static links
46 .endif
48 realall: ${OBJS}
50 FILES=${OBJS}
51 FILESDIR=${LIBDIR}
53 .PATH: ${DIST}/libgcc ${DIST}/libgcc/config
55 .include "../Makefile.tconfigh"
56 EXTRA_FAKEHEADERS= options.h libgcc_tm.h
57 .include "../Makefile.hacks"
59 ${OBJS}: ${DPSRCS}
61 .include <bsd.prog.mk>
63 # Override the default .c -> .o rule.
64 .c.o:
65 ${_MKTARGET_COMPILE}
66 ${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${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
76 .endif
78 .else
80 .include <bsd.prog.mk> # do nothing
82 .endif # ! EXTERNAL_TOOLCHAIN && MKGCC != no