Makefile revision 135029
167811Sobrien# $FreeBSD: head/gnu/lib/csu/Makefile 135029 2004-09-10 06:48:04Z ru $
267811Sobrien
396340SobrienGCCDIR=	${.CURDIR}/../../../contrib/gcc
496340SobrienCCDIR=	${.CURDIR}/../../usr.bin/cc
596340Sobrien.include "${CCDIR}/Makefile.tgt"
696340Sobrien
796796Speter.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
896796Speter
9132751SkanSRCS=		crtstuff.c tconfig.h tm.h
1067811SobrienOBJS=		crtbegin.o crtend.o
1167811SobrienSOBJS=		crtbegin.So crtend.So
12115663SobrienCSTD?=		gnu89
1396340SobrienCFLAGS+=	-DIN_GCC -DHAVE_LD_EH_FRAME_HDR
1496340SobrienCFLAGS+=	-finhibit-size-directive -fno-inline-functions \
15117424Skan		-fno-exceptions -fno-zero-initialized-in-bss \
16132751Skan		-fno-omit-frame-pointer -fno-unit-at-a-time
1796340SobrienCFLAGS+=	-I${GCCDIR}/config -I${GCCDIR} -I. \
1896340Sobrien		-I${CCDIR}/cc_tools
1996796SpeterCRTS_CFLAGS=	-DCRTSTUFFS_O -DSHARED ${PICFLAG}
20126688SruMKDEP=		-DCRT_BEGIN
2167811Sobrien
22111608Sru.if ${MACHINE_ARCH} == "ia64"
2396796SpeterBEGINSRC=	crtbegin.asm
2496796SpeterENDSRC=		crtend.asm
2596796SpeterCFLAGS+=	-x assembler-with-cpp	# Ugly hack
26117496SkanCFLAGS+=	-include osreldate.h
2796796Speter.undef SRCS				# hack for 'make depend'
2896796Speter.endif
29111608Sru.if ${MACHINE_ARCH} == "powerpc"
3096778SobrienTGTOBJS=	crtsavres.o
3196778SobrienSRCS+=		crtsavres.asm
3296778Sobrien.endif
33111608Sru.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64"
3496340SobrienTGTOBJS=	crtfastmath.o
3596340SobrienSRCS+=		crtfastmath.c
3696340Sobrien.endif
37135029SruBEGINSRC?=	crtstuff.c
38135029SruENDSRC?=	crtstuff.c
3967811Sobrien
4096340Sobrienall: ${OBJS} ${SOBJS} ${TGTOBJS}
41135029Sru${OBJS} ${SOBJS}: ${SRCS:M*.h}
4296340Sobrien
4396530SruCLEANFILES=	${OBJS} ${SOBJS} ${TGTOBJS}
4496530Sru
4596796Spetercrtbegin.o:	${BEGINSRC}
4667811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
4797314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
4867811Sobrien
4996796Spetercrtbegin.So:	${BEGINSRC}
5067811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
5197314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
5267811Sobrien
5396796Spetercrtend.o:	${ENDSRC}
5467811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_END \
5597314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
5667811Sobrien
5796796Spetercrtend.So:	${ENDSRC}
5867811Sobrien	${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
5997314Sobrien		-c -o ${.TARGET} ${.ALLSRC:N*.h}
6067811Sobrien
61132751SkanCLEANFILES+=	tm.h tconfig.h
62132751Skantm.h tconfig.h: ${CCDIR}/cc_tools/Makefile
6396340Sobrien	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
6467811Sobrien
6567811Sobrienrealinstall:
6696340Sobrien.for file in ${OBJS} ${SOBJS} ${TGTOBJS}
67100872Sru	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
6867811Sobrien	    ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
6967811Sobrien.endfor
7067811Sobrien
7167811Sobrien.include <bsd.lib.mk>
72