Minor Makefile cleanup. Do not use Makefile variables named 'version' and

'target'. Latter is problematic in particular as apparently FreeBSD's
bsd.prog.mk re-defines it under some circumstances. This causes an
unexpected failures like -dumpmachine not working for cc while working
fine for c++.

Do not re-define IN_GCC in multipe places, it gets inherited from
Makefile.in anyway.

PR:		gnu/110143
Submitted by:	usleepless at gmail
This commit is contained in:
Alexander Kabaev 2007-03-12 00:28:06 +00:00
parent fa393cd523
commit 04d56e6287
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167471
5 changed files with 8 additions and 9 deletions

View File

@ -2,14 +2,14 @@
# Front-end-only bits
version!= sed -n /version_string/p ${GCCDIR}/version.c | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'
GCC_VERSION!= sed -n /version_string/p ${GCCDIR}/version.c | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'
#
# These were previously defined in gcc.c. Just copy previous values from
# there. We ifdef most of them out for FREEBSD_NATIVE builds anyway.
# gcc.c won't compile without them though.
DRIVER_DEFINES = \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target)\" \
-DDEFAULT_TARGET_VERSION=\"$(GCC_VERSION)\" \
-DDEFAULT_TARGET_MACHINE=\"$(GCC_TARGET)\" \
CFLAGS+= ${DRIVER_DEFINES}

View File

@ -16,7 +16,7 @@ MD_FILE= ../cc_tools/arm-diked.md
.else
MD_FILE= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
.endif
target= ${TARGET_ARCH}-undermydesk-freebsd
GCC_TARGET= ${TARGET_ARCH}-undermydesk-freebsd
CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H
CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\"

View File

@ -1,6 +1,7 @@
# $FreeBSD$
.include "../Makefile.inc"
.include "../Makefile.fe"
.PATH: ${GCCDIR}
@ -8,7 +9,7 @@ PROG= c++filt
SRCS= cp-demangle.c
NO_MAN=
CFLAGS+= -DSTANDALONE_DEMANGLER -DIN_GCC -DVERSION=\"$(version)\"
CFLAGS+= -DSTANDALONE_DEMANGLER -DVERSION=\"$(GCC_VERSION)\"
DPADD= ${LIBCC_INT}
LDADD= ${LIBCC_INT}

View File

@ -78,7 +78,7 @@ insn-$F.c: ${.OBJDIR}/../cc_tools/gen$F
.endfor
CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -DTARGET_NAME=\"${target}\" -DIN_GCC
CFLAGS+= -DTARGET_NAME=\"${GCC_TARGET}\"
.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
CFLAGS += -DTARGET_ENDIAN_DEFAULT=ARM_FLAG_BIG_END
@ -88,6 +88,6 @@ CFLAGS += -DTARGET_ENDIAN_DEFAULT=ARM_FLAG_BIG_END
# pollute compiler command line for all other files.
c-pch.o: c-pch.c
${CC} ${CFLAGS} -DHOST_MACHINE=\"${host}\" \
-DTARGET_MACHINE=\"${target}\" -c ${.IMPSRC}
-DTARGET_MACHINE=\"${GCC_TARGET}\" -c ${.IMPSRC}
.include <bsd.lib.mk>

View File

@ -8,8 +8,6 @@
PROG= f77
SRCS= gcc.c g77spec.c
CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
CFLAGS+= -DFORTRAN_INIT=\"-lg2c\" -DFORTRAN_INIT_PROFILE=\"-lg2c_p\"
DPADD= ${LIBCC_INT}