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}
23 .if ${MACHINE_ARCH} == "ia64"
24 BEGINSRC= crtbegin.asm
26 CFLAGS+= -x assembler-with-cpp # Ugly hack
27 CFLAGS+= -include osreldate.h
28 .undef SRCS # hack for 'make depend'
30 .if ${MACHINE_ARCH} == "powerpc"
34 .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64"
35 TGTOBJS= crtfastmath.o
41 all: ${OBJS} ${SOBJS} ${TGTOBJS}
42 ${OBJS} ${SOBJS}: ${SRCS:M*.h}
44 CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
46 crtbegin.o: ${BEGINSRC}
47 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
48 -c -o ${.TARGET} ${.ALLSRC:N*.h}
50 crtbeginT.o: ${BEGINSRC}
51 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
52 -c -o ${.TARGET} ${.ALLSRC:N*.h}
54 crtbegin.So: ${BEGINSRC}
55 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
56 -c -o ${.TARGET} ${.ALLSRC:N*.h}
59 ${CC} ${CFLAGS} -g0 -DCRT_END \
60 -c -o ${.TARGET} ${.ALLSRC:N*.h}
63 ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
64 -c -o ${.TARGET} ${.ALLSRC:N*.h}
66 CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
67 tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
68 ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
71 .for file in ${OBJS} ${SOBJS} ${TGTOBJS}
72 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
73 ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}