2004-02-13 02:17:59 +03:00
|
|
|
# $NetBSD: Makefile,v 1.21 2004/02/12 23:17:59 mrg Exp $
|
2003-07-25 20:32:23 +04:00
|
|
|
|
|
|
|
REQUIRETOOLS= yes
|
|
|
|
NOLINT= # defined
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
LIB= gcc
|
|
|
|
|
|
|
|
.cc: # disable .cc->NULL transform
|
|
|
|
|
2004-01-02 14:58:32 +03:00
|
|
|
.if exists(${.CURDIR}/arch/${MACHINE_ARCH}.mk) && ${MKGCC} != "no"
|
|
|
|
.include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
|
2003-07-25 20:32:23 +04:00
|
|
|
|
|
|
|
DIST= ${NETBSDSRCDIR}/gnu/dist/gcc
|
|
|
|
GNUHOSTDIST= ${DIST}
|
|
|
|
GCCARCH= ${NETBSDSRCDIR}/gnu/usr.bin/gcc3/arch/${MACHINE_ARCH}
|
2003-07-30 09:33:25 +04:00
|
|
|
GCCARCHXX= ${NETBSDSRCDIR}/gnu/lib/libstdc++-v3/arch/${MACHINE_ARCH}
|
2003-07-25 20:32:23 +04:00
|
|
|
|
2004-02-11 19:22:51 +03:00
|
|
|
GCPPFLAGS= ${G_LIBGCC2_CFLAGS} ${G_USE_COLLECT2} ${G_INCLUDES}
|
2003-07-25 20:32:23 +04:00
|
|
|
CPPFLAGS+= -I${.CURDIR}
|
2003-08-01 17:55:36 +04:00
|
|
|
CPPFLAGS+= -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
|
2004-02-13 02:17:59 +03:00
|
|
|
CPPFLAGS+= -I${G_EXTRA_HEADERS:H:u}
|
2003-08-01 17:55:36 +04:00
|
|
|
CPPFLAGS+= -I${DIST}/gcc/cp -I${GCCARCHXX} -I.
|
2003-07-25 20:32:23 +04:00
|
|
|
|
|
|
|
LIB2FUNCS= ${G_LIB2FUNCS_1:=.c} ${G_LIB2FUNCS_2:=.c} ${G_LIB2FUNCS_ST:=.c}
|
|
|
|
LIB2DIVMOD= ${G_LIB2_DIVMOD_FUNCS:=.c}
|
|
|
|
LIB2_EH= ${G_LIB2ADDEH:M*.c:T}
|
2004-02-11 19:22:51 +03:00
|
|
|
.if !empty(G_LIB1ASMFUNCS)
|
2003-10-06 09:10:13 +04:00
|
|
|
LIB1ASMFUNCS= ${G_LIB1ASMFUNCS:=.S}
|
2004-02-11 19:22:51 +03:00
|
|
|
.endif
|
2003-07-25 20:32:23 +04:00
|
|
|
|
2003-10-06 09:10:13 +04:00
|
|
|
SRCS+= ${LIB2FUNCS} ${LIB2DIVMOD} ${LIB2_EH} \
|
2003-10-27 20:19:58 +03:00
|
|
|
${G_LIB2ADD:T:S/.asm/.S/} ${LIB1ASMFUNCS} \
|
|
|
|
${G_LIB2FUNCS_EXTRA}
|
2003-07-25 20:32:23 +04:00
|
|
|
|
2004-01-02 14:58:32 +03:00
|
|
|
DPSRCS+= ${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h
|
2003-10-16 10:15:20 +04:00
|
|
|
CLEANFILES+= ${LIB2FUNCS} ${LIB2DIVMOD} cs-tconfig.h tconfig.h
|
2003-07-25 20:32:23 +04:00
|
|
|
|
2003-10-27 20:19:58 +03:00
|
|
|
# XXX
|
|
|
|
.if ${MACHINE_ARCH} == "m68000"
|
|
|
|
CPICFLAGS:=
|
|
|
|
COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
|
2003-10-28 04:25:33 +03:00
|
|
|
_TRADITIONAL_CPP=
|
2003-10-27 20:19:58 +03:00
|
|
|
fpgnulib.c: ${DIST}/gcc/config/m68k/fpgnulib.c
|
|
|
|
cp ${DIST}/gcc/config/m68k/fpgnulib.c fpgnulib.c
|
|
|
|
xfgnulib.c: ${DIST}/gcc/config/m68k/fpgnulib.c
|
|
|
|
echo '#define EXTFLOAT' > xfgnulib.c
|
|
|
|
cat ${DIST}/gcc/config/m68k/fpgnulib.c >> xfgnulib.c
|
|
|
|
.endif
|
2003-12-12 01:37:27 +03:00
|
|
|
.if ${MACHINE_ARCH} == "powerpc"
|
|
|
|
_TRADITIONAL_CPP=
|
|
|
|
COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c
|
|
|
|
.endif
|
2003-10-27 20:19:58 +03:00
|
|
|
|
2003-07-25 20:32:23 +04:00
|
|
|
${LIB2FUNCS}: ${.CURDIR}/Makefile
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-07-25 20:32:23 +04:00
|
|
|
printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
|
|
|
|
|
|
|
|
${LIB2DIVMOD}: ${.CURDIR}/Makefile
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-07-25 20:32:23 +04:00
|
|
|
printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
|
|
|
|
|
2003-10-06 09:10:13 +04:00
|
|
|
.if !empty(LIB1ASMFUNCS)
|
|
|
|
${LIB1ASMFUNCS}: ${.CURDIR}/Makefile
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-10-06 09:10:13 +04:00
|
|
|
printf '#define L${.PREFIX}\n#include <${G_LIB1ASMSRC}>\n' >${.TARGET}
|
|
|
|
.endif
|
|
|
|
|
2004-02-11 19:22:51 +03:00
|
|
|
${G_LIB2ADD:M${GNUHOSTDIST}/*:T:S/.asm/.S/}: ${.CURDIR}/Makefile ${G_LIB2ADD}
|
2003-08-22 06:39:56 +04:00
|
|
|
@echo copying ${G_LIB2ADD}
|
|
|
|
for i in ${G_LIB2ADD}; do \
|
|
|
|
j=$${i##*/}; \
|
|
|
|
j=`echo $$j | sed 's/\.asm$$/\.S/'`; \
|
|
|
|
cp $$i $$j; \
|
|
|
|
done
|
|
|
|
@echo copying ${G_LIB2ADD} complete
|
|
|
|
|
2003-09-05 13:54:30 +04:00
|
|
|
${LIB2_EH:.c=.o}:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-07-25 20:32:23 +04:00
|
|
|
${COMPILE.c} ${CPICFLAGS} -fexceptions -o ${.TARGET} ${.IMPSRC}
|
|
|
|
|
|
|
|
${G_LIB2_DIVMOD_FUNCS:=.o}:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-07-25 20:32:23 +04:00
|
|
|
${COMPILE.c} ${CPICFLAGS} -fexceptions -fnon-call-exceptions -o ${.TARGET} ${.IMPSRC}
|
|
|
|
|
|
|
|
dp-bit.c: ${.CURDIR}/Makefile
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-07-25 20:32:23 +04:00
|
|
|
printf '#define FLOAT\n#include <fp-bit.c>\n' >${.TARGET}
|
|
|
|
|
|
|
|
.PATH: ${DIST}/gcc ${DIST}/gcc/cp ${DIST}/gcc/cp/inc ${DIST}/gcc/config \
|
|
|
|
${G_CONFIGDIR}
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|
|
|
|
|
|
|
|
tconfig.h:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-07-25 20:32:23 +04:00
|
|
|
TM_DEFINES="$(G_tm_defines)" \
|
|
|
|
HEADERS="$(G_xm_file)" XM_DEFINES="$(G_xm_defines)" \
|
|
|
|
TARGET_CPU_DEFAULT="" \
|
2003-10-19 18:52:03 +04:00
|
|
|
${HOST_SH} $(GNUHOSTDIST)/gcc/mkconfig.sh tconfig.h
|
2003-07-25 20:32:23 +04:00
|
|
|
|
|
|
|
.else
|
|
|
|
.include <bsd.prog.mk> # do nothing
|
|
|
|
.endif
|