Home | History | Annotate | Line # | Download | only in crtstuff
Makefile revision 1.7
      1  1.7     joerg #	$NetBSD: Makefile,v 1.7 2012/02/28 20:26:07 joerg 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.1       mrg .include <bsd.own.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.2       mrg DIST=		${NETBSDSRCDIR}/external/gpl3/gcc/dist
     14  1.1       mrg GNUHOSTDIST=	${DIST}
     15  1.2       mrg GCCARCH=	${NETBSDSRCDIR}/external/gpl3/gcc/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.1       mrg CPPFLAGS+=	-I.
     21  1.3       mrg COPTS+=		-finhibit-size-directive \
     22  1.3       mrg 		-fno-inline \
     23  1.3       mrg 		-fno-exceptions \
     24  1.3       mrg 		-fno-zero-initialized-in-bss \
     25  1.3       mrg 		-fno-toplevel-reorder \
     26  1.3       mrg 		-fno-tree-vectorize \
     27  1.3       mrg 		-fno-omit-frame-pointer \
     28  1.3       mrg 		-fno-asynchronous-unwind-tables
     29  1.1       mrg 
     30  1.1       mrg GCFLAGS=	${GALLCFLAGS:N-D*:N-I*:N-i*:N./*}
     31  1.1       mrg 
     32  1.1       mrg DPSRCS+=	${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h
     33  1.1       mrg 
     34  1.1       mrg .include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
     35  1.1       mrg 
     36  1.1       mrg SRCS+=		crtbegin.c crtend.c
     37  1.1       mrg OBJS+=		crtbegin.o crtend.o
     38  1.1       mrg .if ${MKPIC} != "no"
     39  1.1       mrg SRCS+=		crtbeginS.c crtendS.c
     40  1.1       mrg OBJS+=		crtbeginS.o crtendS.o	# for shared libraries
     41  1.3       mrg CPPFLAGS.crtbeginS.o+=	-fPIC -DPIC
     42  1.3       mrg CPPFLAGS.crtendS.o+=	-fPIC -DPIC
     43  1.1       mrg SRCS+=		crtbeginT.c
     44  1.1       mrg OBJS+=		crtbeginT.o		# for -static links
     45  1.1       mrg .endif
     46  1.1       mrg 
     47  1.1       mrg realall: ${OBJS}
     48  1.1       mrg 
     49  1.1       mrg FILES=${OBJS}
     50  1.1       mrg FILESDIR=${LIBDIR}
     51  1.1       mrg 
     52  1.1       mrg .PATH: ${DIST}/gcc ${DIST}/gcc/config ${G_CONFIGDIR}
     53  1.1       mrg 
     54  1.3       mrg .include "../Makefile.tconfigh"
     55  1.5       mrg EXTRA_FAKEHEADERS= options.h
     56  1.4       mrg .include "../Makefile.hacks"
     57  1.1       mrg 
     58  1.1       mrg ${OBJS}: ${DPSRCS}
     59  1.1       mrg 
     60  1.1       mrg .include <bsd.prog.mk>
     61  1.1       mrg 
     62  1.1       mrg # Override the default .c -> .o rule.
     63  1.1       mrg .c.o:
     64  1.1       mrg 	${_MKTARGET_COMPILE}
     65  1.6  macallan 	${CC} ${CPPFLAGS} ${CPPFLAGS.${.TARGET}} ${GCFLAGS} ${COPTS} ${COPTS.${.TARGET}} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
     66  1.1       mrg 	mv ${.TARGET}.o ${.TARGET}
     67  1.1       mrg 
     68  1.1       mrg .if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el")
     69  1.1       mrg # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
     70  1.1       mrg # and GCC configury passes -finhibit-size-directive which causes mips-gas
     71  1.1       mrg # to barf.  Don't know what the real fix for this is...
     72  1.1       mrg #
     73  1.1       mrg # XXX should be COPTS, but that's too early
     74  1.1       mrg CPUFLAGS+=-Wa,--no-warn
     75  1.1       mrg .endif
     76  1.1       mrg 
     77  1.1       mrg .else
     78  1.1       mrg 
     79  1.1       mrg .include <bsd.prog.mk>			# do nothing
     80  1.1       mrg 
     81  1.1       mrg .endif	# ! EXTERNAL_TOOLCHAIN && MKGCC != no
     82