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= crtbeginS.o crtendS.o
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 ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
28 CFLAGS+= -DTARGET_ARM_EABI
31 .if ${MACHINE_CPUARCH} == "ia64"
32 BEGINSRC= crtbegin.asm
34 CFLAGS+= -x assembler-with-cpp # Ugly hack
35 CFLAGS+= -include osreldate.h
36 .undef SRCS # hack for 'make depend'
38 .if ${MACHINE_CPUARCH} == "powerpc"
42 .if ${MACHINE_CPUARCH} == "sparc64"
43 TGTOBJS= crtfastmath.o
49 all: ${OBJS} ${SOBJS} ${TGTOBJS}
50 ${OBJS} ${SOBJS}: ${SRCS:M*.h}
52 CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
54 crtbegin.o: ${BEGINSRC}
55 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
56 -c -o ${.TARGET} ${.ALLSRC:N*.h}
58 crtbeginT.o: ${BEGINSRC}
59 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \
60 -c -o ${.TARGET} ${.ALLSRC:N*.h}
62 crtbeginS.o: ${BEGINSRC}
63 ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
64 -c -o ${.TARGET} ${.ALLSRC:N*.h}
67 ${CC} ${CFLAGS} -g0 -DCRT_END \
68 -c -o ${.TARGET} ${.ALLSRC:N*.h}
71 ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
72 -c -o ${.TARGET} ${.ALLSRC:N*.h}
74 CLEANFILES+= tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
75 tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
76 ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
79 .for file in ${OBJS} ${SOBJS} ${TGTOBJS}
80 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
81 ${file} ${DESTDIR}${LIBDIR}/${file}