2001-12-18 03:11:35 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2014-05-06 04:22:01 +00:00
|
|
|
.include <src.opts.mk>
|
2009-02-21 15:04:31 +00:00
|
|
|
MK_SSP= no
|
|
|
|
|
2002-04-05 09:02:52 +00:00
|
|
|
GCCDIR= ${.CURDIR}/../../../contrib/gcc
|
2007-05-19 04:25:59 +00:00
|
|
|
GCCLIB= ${.CURDIR}/../../../contrib/gcclibs
|
2002-04-06 19:13:25 +00:00
|
|
|
CCDIR= ${.CURDIR}/../../usr.bin/cc
|
|
|
|
.include "${CCDIR}/Makefile.tgt"
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
|
|
|
|
|
2007-05-19 04:25:59 +00:00
|
|
|
SRCS= crtstuff.c tconfig.h tm.h options.h
|
|
|
|
OBJS= crtbegin.o crtend.o crtbeginT.o
|
2012-05-17 20:38:01 +00:00
|
|
|
SOBJS= crtbeginS.o crtendS.o
|
2003-06-02 02:29:26 +00:00
|
|
|
CSTD?= gnu89
|
2007-05-19 04:25:59 +00:00
|
|
|
CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
|
2013-12-22 17:51:33 +00:00
|
|
|
CFLAGS.gcc+= -finhibit-size-directive -fno-toplevel-reorder
|
2013-12-22 12:53:56 +00:00
|
|
|
CFLAGS+= -fno-inline-functions -fno-exceptions \
|
|
|
|
-fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables \
|
|
|
|
-fno-omit-frame-pointer
|
2007-05-19 04:25:59 +00:00
|
|
|
CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
|
2002-04-06 19:13:25 +00:00
|
|
|
-I${CCDIR}/cc_tools
|
2002-05-17 07:55:08 +00:00
|
|
|
CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2014-10-01 08:26:51 +00:00
|
|
|
.if ${TARGET_CPUARCH} == "arm"
|
2013-01-17 05:56:28 +00:00
|
|
|
CFLAGS+= -DTARGET_ARM_EABI
|
|
|
|
.endif
|
|
|
|
|
2010-08-23 22:24:11 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "powerpc"
|
2002-05-17 03:04:47 +00:00
|
|
|
TGTOBJS= crtsavres.o
|
|
|
|
SRCS+= crtsavres.asm
|
|
|
|
.endif
|
2010-08-23 22:24:11 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "sparc64"
|
2002-05-07 00:08:30 +00:00
|
|
|
TGTOBJS= crtfastmath.o
|
|
|
|
SRCS+= crtfastmath.c
|
2002-04-06 19:13:25 +00:00
|
|
|
.endif
|
2007-10-13 05:50:43 +00:00
|
|
|
BEGINSRC?= crtstuff.c
|
|
|
|
ENDSRC?= crtstuff.c
|
2002-04-06 19:13:25 +00:00
|
|
|
|
2015-09-21 18:39:13 +00:00
|
|
|
FILES= ${OBJS} ${SOBJS} ${TGTOBJS}
|
|
|
|
FILESMODE= ${LIBMODE}
|
|
|
|
FILESOWN= ${LIBOWN}
|
|
|
|
FILESGRP= ${LIBGRP}
|
|
|
|
FILESDIR= ${LIBDIR}
|
2015-09-21 21:44:02 +00:00
|
|
|
# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
|
|
|
|
.undef LIBRARIES_ONLY
|
2015-09-21 18:39:13 +00:00
|
|
|
|
2004-09-10 06:48:04 +00:00
|
|
|
${OBJS} ${SOBJS}: ${SRCS:M*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-13 15:28:00 +00:00
|
|
|
CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
|
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
crtbegin.o: ${BEGINSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2007-05-19 04:25:59 +00:00
|
|
|
crtbeginT.o: ${BEGINSRC}
|
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
|
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
|
|
|
|
2012-05-17 20:38:01 +00:00
|
|
|
crtbeginS.o: ${BEGINSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
crtend.o: ${ENDSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_END \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2012-05-17 20:38:01 +00:00
|
|
|
crtendS.o: ${ENDSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2007-05-19 04:25:59 +00:00
|
|
|
CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
|
2016-04-12 02:45:19 +00:00
|
|
|
tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY
|
2014-06-24 22:15:27 +00:00
|
|
|
(cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET})
|
2001-12-18 03:11:35 +00:00
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|