summaryrefslogtreecommitdiff
path: root/tools/gdb/Makefile
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2009-11-04 18:41:41 -0600
committerWolfgang Denk <wd@denx.de>2009-12-02 22:58:46 +0100
commitd984fed068b3bec8a7edaf7a3de71479abde080a (patch)
tree16be1b5b230b6b7e1e3abf060f38a3b6589df65b /tools/gdb/Makefile
parentbf44f3f327acddba202ff67f70192926ea47dfd1 (diff)
downloadu-boot-imx-d984fed068b3bec8a7edaf7a3de71479abde080a.zip
u-boot-imx-d984fed068b3bec8a7edaf7a3de71479abde080a.tar.gz
u-boot-imx-d984fed068b3bec8a7edaf7a3de71479abde080a.tar.bz2
makefiles: fixes for building build tools
Currently, some of the tools instead set CC to be HOSTCC in order to re-use some pattern rules -- but this fails when the user overrides CC on the make command line. Also, the HOSTCFLAGS in tools/Makefile are currently not being used because config.mk overwrites them. This patch adds static pattern rules for files that have been requested to be built with the native compiler using $(HOSTSRCS) and $(HOSTOBJS), and converts the tools to use them. It restores easylogo to using the host compiler, which was broken by commit 38d299c2db81bd889c601b5dfc12c4e83ef83333 (if this was an intentional change, please let me know -- but it seems to be a build tool). It restores -pedantic and the special flags for darwin and cygwin that were requested in tools/makefile (but keeps the flags added by config.mk) -- hopefully someone can test this on those platforms. It no longer conditionalizes -pedantic on not being darwin; it wasn't clear that that was intentional, and unless there's a real problem it's just inviting people to contribute non-pedantic patches to those files (I'm not a fan of -pedantic personally, but if it's on for one platform it should be on for all). HOST_LDFLAGS is renamed HOSTLDFLAGS for consistency with the previous HOST_CFLAGS to HOSTCFLAGS rename. A new HOSTCFLAGS_NOPED is made available for those files which currently cannot be built with -pedantic, and replaces the old FIT_CFLAGS. imls now uses the cross compiler properly, rather than by trying to reconstruct CC using the typoed $(CROSS_COMPILER). envcrc.c is now dependency-processed unconditionally -- previously it would be built without being on (HOST)SRCS if CONFIG_ENV_IS_EMBEDDED was not selected. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'tools/gdb/Makefile')
-rw-r--r--tools/gdb/Makefile15
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/gdb/Makefile b/tools/gdb/Makefile
index 0a5687d..90037c7 100644
--- a/tools/gdb/Makefile
+++ b/tools/gdb/Makefile
@@ -30,17 +30,14 @@ BINS = gdbsend gdbcont
COBJS = gdbsend.o gdbcont.o error.o remote.o serial.o
-OBJS := $(addprefix $(obj),$(COBJS))
-SRCS := $(COBJS:.o=.c)
+HOSTOBJS := $(addprefix $(obj),$(COBJS))
+HOSTSRCS := $(COBJS:.o=.c)
BINS := $(addprefix $(obj),$(BINS))
#
# Use native tools and options
#
-CPPFLAGS = -I$(BFD_ROOT_DIR)/include
-CFLAGS = $(HOSTCFLAGS) -O $(CPPFLAGS)
-CC = $(HOSTCC)
-MAKEDEPEND = makedepend
+HOSTCPPFLAGS = -I$(BFD_ROOT_DIR)/include
HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')
@@ -54,13 +51,13 @@ else # ! CYGWIN
all: $(obj).depend $(BINS)
$(obj)gdbsend: $(obj)gdbsend.o $(obj)error.o $(obj)remote.o $(obj)serial.o
- $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
+ $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
$(obj)gdbcont: $(obj)gdbcont.o $(obj)error.o $(obj)remote.o $(obj)serial.o
- $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
+ $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
clean:
- rm -f $(OBJS)
+ rm -f $(HOSTOBJS)
distclean: clean
rm -f $(BINS) $(obj)core $(obj)*.bak $(obj).depend