summaryrefslogtreecommitdiff
path: root/tools/gdb
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-02-04 17:24:10 +0900
committerTom Rini <trini@ti.com>2014-02-19 11:07:49 -0500
commit940db16d2e6ce69f769f790bf1def56978f0ac6c (patch)
tree1b2baa7449a5440ac82ffb1af1b5c6c02cdfd31f /tools/gdb
parentad71fa9971aeb0340221f82884b7794c497322be (diff)
tools: convert makefiles to kbuild style
Before this commit, makefiles under tools/ directory were implemented with their own way. This commit refactors them by using "hostprogs-y" variable. Several C sources have been added to wrap other C sources to simplify Makefile. For example, tools/crc32.c includes lib/crc32.c Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Diffstat (limited to 'tools/gdb')
-rw-r--r--tools/gdb/Makefile43
1 files changed, 6 insertions, 37 deletions
diff --git a/tools/gdb/Makefile b/tools/gdb/Makefile
index dd98fb65c0..850bb9b20e 100644
--- a/tools/gdb/Makefile
+++ b/tools/gdb/Makefile
@@ -8,49 +8,18 @@
# SPDX-License-Identifier: GPL-2.0+
#
-include $(TOPDIR)/config.mk
-
-BINS = gdbsend gdbcont
-
-COBJS = gdbsend.o gdbcont.o error.o remote.o serial.o
-
-HOSTOBJS := $(addprefix $(obj),$(COBJS))
-HOSTSRCS := $(COBJS:.o=.c)
-BINS := $(addprefix $(obj),$(BINS))
+ifneq ($(HOSTOS),cygwin)
#
# Use native tools and options
#
-HOSTCPPFLAGS = -I$(BFD_ROOT_DIR)/include
-
-ifeq ($(HOSTOS),cygwin)
-
-all:
-$(obj).depend:
-
-else # ! CYGWIN
-
-all: $(obj).depend $(BINS)
-
-$(obj)gdbsend: $(obj)gdbsend.o $(obj)error.o $(obj)remote.o $(obj)serial.o
- $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
-
-$(obj)gdbcont: $(obj)gdbcont.o $(obj)error.o $(obj)remote.o $(obj)serial.o
- $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
-
-clean:
- rm -f $(HOSTOBJS)
-
-distclean: clean
- rm -f $(BINS) $(obj)core $(obj)*.bak $(obj).depend
-
-#########################################################################
+HOST_EXTRACFLAGS := -I$(BFD_ROOT_DIR)/include -pedantic
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
+hostprogs-y := gdbsend gdbcont
-sinclude $(obj).depend
+gdbsend-objs := gdbsend.o error.o remote.o serial.o
+gdbcont-objs := gdbcont.o error.o remote.o serial.o
-#########################################################################
+always := $(hostprogs-y)
endif # cygwin