3 GCCDIR= ${.CURDIR}/../../../contrib/gcc
4 GCCLIB= ${.CURDIR}/../../../contrib/gcclibs
5 CCDIR= ${.CURDIR}/../../usr.bin/cc
6 .include "${CCDIR}/Makefile.tgt"
8 .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
10 SRCS= crtstuff.c tconfig.h tm.h options.h
11 OBJS= crtbegin.o crtend.o crtbeginT.o
12 SOBJS= crtbegin.So crtend.So
14 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
15 CFLAGS+= -finhibit-size-directive -fno-inline-functions \
16 -fno-exceptions -fno-zero-initialized-in-bss \
17 -fno-zero-initialized-in-bss -fno-toplevel-reorder
18 CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
20 CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
24 .if ${MACHINE_ARCH} == "ia64"
25 BEGINSRC= crtbegin.asm
27 CFLAGS+= -x assembler-with-cpp # Ugly hack
28 CFLAGS+= -D_OSRELDATE_H -include osreldate.h
29 .undef SRCS # hack for 'make depend'
31 .if ${MACHINE_ARCH} == "powerpc"
35 .if ${MACHINE_ARCH} == "sparc64"
36 TGTOBJS= crtfastmath.o
42 all: ${OBJS} ${SOBJS} ${TGTOBJS}
43 ${OBJS} ${SOBJS}: ${SRCS:M*.h}
45 CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
47 crtbegin.o: ${BEGINSRC}
48 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
49 -c -o ${.TARGET} ${.ALLSRC:N*.h}
51 crtbeginT.o: ${BEGINSRC}
52 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
53 -c -o ${.TARGET} ${.ALLSRC:N*.h}
55 crtbegin.So: ${BEGINSRC}
56 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
57 -c -o ${.TARGET} ${.ALLSRC:N*.h}
60 ${CC} ${CFLAGS} -g0 -DCRT_END \
61 -c -o ${.TARGET} ${.ALLSRC:N*.h}
64 ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
65 -c -o ${.TARGET} ${.ALLSRC:N*.h}
67 CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
68 tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
69 ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
72 .for file in ${OBJS} ${SOBJS} ${TGTOBJS}
73 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
74 ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}