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