Makefile revision 183440
167811Sobrien# $FreeBSD: head/gnu/lib/csu/Makefile 183440 2008-09-28 19:17:54Z marcel $
267811Sobrien
396340SobrienGCCDIR=	${.CURDIR}/../../../contrib/gcc
4169718SkanGCCLIB=	${.CURDIR}/../../../contrib/gcclibs
596340SobrienCCDIR=	${.CURDIR}/../../usr.bin/cc
696340Sobrien.include "${CCDIR}/Makefile.tgt"
796340Sobrien
896796Speter.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
996796Speter
10169718SkanSRCS=		crtstuff.c tconfig.h tm.h options.h
11169718SkanOBJS=		crtbegin.o crtend.o crtbeginT.o
1267811SobrienSOBJS=		crtbegin.So crtend.So
13115663SobrienCSTD?=		gnu89
14169718SkanCFLAGS+=	-DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
1596340SobrienCFLAGS+=	-finhibit-size-directive -fno-inline-functions \
16117424Skan		-fno-exceptions -fno-zero-initialized-in-bss \
17169718Skan		-fno-zero-initialized-in-bss -fno-toplevel-reorder
18169718SkanCFLAGS+=	-I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
1996340Sobrien		-I${CCDIR}/cc_tools
2096796SpeterCRTS_CFLAGS=	-DCRTSTUFFS_O -DSHARED ${PICFLAG}
21126688SruMKDEP=		-DCRT_BEGIN
22180012SruWITHOUT_SSP=
2367811Sobrien
24111608Sru.if ${MACHINE_ARCH} == "ia64"
2596796SpeterBEGINSRC=	crtbegin.asm
2696796SpeterENDSRC=		crtend.asm
2796796SpeterCFLAGS+=	-x assembler-with-cpp	# Ugly hack
28183440SmarcelCFLAGS+=	-include osreldate.h
2996796Speter.undef SRCS				# hack for 'make depend'
3096796Speter.endif
31111608Sru.if ${MACHINE_ARCH} == "powerpc"
3296778SobrienTGTOBJS=	crtsavres.o
3396778SobrienSRCS+=		crtsavres.asm
3496778Sobrien.endif
35175623Sru.if ${MACHINE_ARCH} == "sparc64"
3696340SobrienTGTOBJS=	crtfastmath.o
3796340SobrienSRCS+=		crtfastmath.c
3896340Sobrien.endif
39172609SruBEGINSRC?=	crtstuff.c
40172609SruENDSRC?=	crtstuff.c
4167811Sobrien
4296340Sobrienall: ${OBJS} ${SOBJS} ${TGTOBJS}
43135029Sru${OBJS} ${SOBJS}: ${SRCS:M*.h}
4496340Sobrien
4596530SruCLEANFILES=	${OBJS} ${SOBJS} ${TGTOBJS}
4696530Sru
4796796Spetercrtbegin.o:	${BEGINSRC}
4867811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
4997314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
5067811Sobrien
51169718SkancrtbeginT.o:	${BEGINSRC}
52169718Skan	${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
53169718Skan		-c -o ${.TARGET} ${.ALLSRC:N*.h}
54169718Skan
5596796Spetercrtbegin.So:	${BEGINSRC}
5667811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
5797314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
5867811Sobrien
5996796Spetercrtend.o:	${ENDSRC}
6067811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_END \
6197314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
6267811Sobrien
6396796Spetercrtend.So:	${ENDSRC}
6467811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
6597314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
6667811Sobrien
67169718SkanCLEANFILES+=	tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
68169718Skantm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
6996340Sobrien	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
7067811Sobrien
7167811Sobrienrealinstall:
7296340Sobrien.for file in ${OBJS} ${SOBJS} ${TGTOBJS}
73100872Sru	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
7467811Sobrien	    ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
7567811Sobrien.endfor
7667811Sobrien
7767811Sobrien.include <bsd.lib.mk>
78