6 GCCDIR= ${.CURDIR}/../../../contrib/gcc
7 GCCLIB= ${.CURDIR}/../../../contrib/gcclibs
8 CCDIR= ${.CURDIR}/../../usr.bin/cc
9 .include "${CCDIR}/Makefile.tgt"
11 .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
13 SRCS= crtstuff.c tconfig.h tm.h options.h
14 OBJS= crtbegin.o crtend.o crtbeginT.o
15 SOBJS= crtbegin.So crtend.So
17 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
18 CFLAGS+= -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
22 CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
24 CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
27 .if ${MACHINE_ARCH} == "ia64"
28 BEGINSRC= crtbegin.asm
30 CFLAGS+= -x assembler-with-cpp # Ugly hack
31 CFLAGS+= -include osreldate.h
32 .undef SRCS # hack for 'make depend'
34 .if ${MACHINE_ARCH} == "powerpc"
38 .if ${MACHINE_ARCH} == "sparc64"
39 TGTOBJS= crtfastmath.o
45 all: ${OBJS} ${SOBJS} ${TGTOBJS}
46 ${OBJS} ${SOBJS}: ${SRCS:M*.h}
48 CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
50 crtbegin.o: ${BEGINSRC}
51 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
52 -c -o ${.TARGET} ${.ALLSRC:N*.h}
54 crtbeginT.o: ${BEGINSRC}
55 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
56 -c -o ${.TARGET} ${.ALLSRC:N*.h}
58 crtbegin.So: ${BEGINSRC}
59 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
60 -c -o ${.TARGET} ${.ALLSRC:N*.h}
63 ${CC} ${CFLAGS} -g0 -DCRT_END \
64 -c -o ${.TARGET} ${.ALLSRC:N*.h}
67 ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
68 -c -o ${.TARGET} ${.ALLSRC:N*.h}
70 CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
71 tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
72 ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
75 .for file in ${OBJS} ${SOBJS} ${TGTOBJS}
76 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
77 ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}