2001-12-18 03:11:35 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2002-04-05 09:02:52 +00:00
|
|
|
GCCDIR= ${.CURDIR}/../../../contrib/gcc
|
2002-04-06 19:13:25 +00:00
|
|
|
CCDIR= ${.CURDIR}/../../usr.bin/cc
|
|
|
|
.include "${CCDIR}/Makefile.tgt"
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
.PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
|
|
|
|
|
2002-04-06 19:13:25 +00:00
|
|
|
SRCS= crtstuff.c tconfig.h
|
2001-12-18 03:11:35 +00:00
|
|
|
OBJS= crtbegin.o crtend.o
|
|
|
|
SOBJS= crtbegin.So crtend.So
|
2003-06-02 02:29:26 +00:00
|
|
|
CSTD?= gnu89
|
2002-04-05 09:02:52 +00:00
|
|
|
CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR
|
|
|
|
CFLAGS+= -finhibit-size-directive -fno-inline-functions \
|
2003-07-11 05:27:23 +00:00
|
|
|
-fno-exceptions -fno-zero-initialized-in-bss \
|
|
|
|
-fno-omit-frame-pointer
|
2002-04-05 09:02:52 +00:00
|
|
|
CFLAGS+= -I${GCCDIR}/config -I${GCCDIR} -I. \
|
2002-04-06 19:13:25 +00:00
|
|
|
-I${CCDIR}/cc_tools
|
2002-05-17 07:55:08 +00:00
|
|
|
CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
|
2002-05-14 01:00:25 +00:00
|
|
|
MKDEPCMD= CC="${CC}" MKDEP_CPP_OPTS="-M -DCRT_BEGIN" mkdep
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2003-02-27 09:19:31 +00:00
|
|
|
.if ${MACHINE_ARCH} == "ia64"
|
2002-05-17 07:55:08 +00:00
|
|
|
BEGINSRC= crtbegin.asm
|
|
|
|
ENDSRC= crtend.asm
|
|
|
|
CFLAGS+= -x assembler-with-cpp # Ugly hack
|
2003-07-13 02:41:48 +00:00
|
|
|
CFLAGS+= -include osreldate.h
|
2002-05-17 07:55:08 +00:00
|
|
|
.undef SRCS # hack for 'make depend'
|
|
|
|
.endif
|
2003-02-27 09:19:31 +00:00
|
|
|
.if ${MACHINE_ARCH} == "powerpc"
|
2002-05-17 03:04:47 +00:00
|
|
|
TGTOBJS= crtsavres.o
|
|
|
|
SRCS+= crtsavres.asm
|
|
|
|
.endif
|
2003-02-27 09:19:31 +00:00
|
|
|
.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64"
|
2002-05-07 00:08:30 +00:00
|
|
|
TGTOBJS= crtfastmath.o
|
|
|
|
SRCS+= crtfastmath.c
|
2002-04-06 19:13:25 +00:00
|
|
|
.endif
|
2002-05-17 07:55:08 +00:00
|
|
|
BEGINSRC?= crtstuff.c
|
|
|
|
ENDSRC?= crtstuff.c
|
2002-04-06 19:13:25 +00:00
|
|
|
|
|
|
|
all: ${OBJS} ${SOBJS} ${TGTOBJS}
|
2002-05-26 17:09:31 +00:00
|
|
|
${OBJS} ${SOBJS}: tconfig.h
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-13 15:28:00 +00:00
|
|
|
CLEANFILES= ${OBJS} ${SOBJS} ${TGTOBJS}
|
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
crtbegin.o: ${BEGINSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
crtbegin.So: ${BEGINSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
crtend.o: ${ENDSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_END \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-17 07:55:08 +00:00
|
|
|
crtend.So: ${ENDSRC}
|
2001-12-18 03:11:35 +00:00
|
|
|
${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
|
2002-05-26 17:09:31 +00:00
|
|
|
-c -o ${.TARGET} ${.ALLSRC:N*.h}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
2002-05-13 15:28:00 +00:00
|
|
|
CLEANFILES+= tconfig.h
|
2002-04-06 19:13:25 +00:00
|
|
|
tconfig.h: ${CCDIR}/cc_tools/Makefile
|
2002-05-07 00:08:30 +00:00
|
|
|
${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
|
2001-12-18 03:11:35 +00:00
|
|
|
|
|
|
|
realinstall:
|
2002-04-06 19:13:25 +00:00
|
|
|
.for file in ${OBJS} ${SOBJS} ${TGTOBJS}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
2001-12-18 03:11:35 +00:00
|
|
|
${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|