1# $FreeBSD$ 2 3GCCDIR= ${.CURDIR}/../../../contrib/gcc 4CCDIR= ${.CURDIR}/../../usr.bin/cc 5.include "${CCDIR}/Makefile.tgt" 6 7.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR} 8 9SRCS= crtstuff.c tconfig.h 10OBJS= crtbegin.o crtend.o 11SOBJS= crtbegin.So crtend.So 12CSTD?= gnu89 13CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR 14CFLAGS+= -finhibit-size-directive -fno-inline-functions \ 15 -fno-exceptions -fno-omit-frame-pointer 16CFLAGS+= -I${GCCDIR}/config -I${GCCDIR} -I. \ 17 -I${CCDIR}/cc_tools 18CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} 19MKDEPCMD= CC="${CC}" MKDEP_CPP_OPTS="-M -DCRT_BEGIN" mkdep 20 21.if ${MACHINE_ARCH} == "ia64" 22BEGINSRC= crtbegin.asm 23ENDSRC= crtend.asm 24CFLAGS+= -x assembler-with-cpp # Ugly hack 25.undef SRCS # hack for 'make depend' 26.endif 27.if ${MACHINE_ARCH} == "powerpc" 28TGTOBJS= crtsavres.o 29SRCS+= crtsavres.asm 30.endif 31.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64" 32TGTOBJS= crtfastmath.o 33SRCS+= crtfastmath.c 34.endif 35BEGINSRC?= crtstuff.c 36ENDSRC?= crtstuff.c 37 38all: ${OBJS} ${SOBJS} ${TGTOBJS} 39${OBJS} ${SOBJS}: tconfig.h 40 41CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS} 42 43crtbegin.o: ${BEGINSRC} 44 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \ 45 -c -o ${.TARGET} ${.ALLSRC:N*.h} 46 47crtbegin.So: ${BEGINSRC} 48 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \ 49 -c -o ${.TARGET} ${.ALLSRC:N*.h} 50 51crtend.o: ${ENDSRC} 52 ${CC} ${CFLAGS} -g0 -DCRT_END \ 53 -c -o ${.TARGET} ${.ALLSRC:N*.h} 54 55crtend.So: ${ENDSRC} 56 ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ 57 -c -o ${.TARGET} ${.ALLSRC:N*.h} 58 59CLEANFILES+= tconfig.h 60tconfig.h: ${CCDIR}/cc_tools/Makefile 61 ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET} 62 63realinstall: 64.for file in ${OBJS} ${SOBJS} ${TGTOBJS} 65 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ 66 ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/} 67.endfor 68 69.include <bsd.lib.mk> 70