aboutsummaryrefslogtreecommitdiff
path: root/tools/gdb/Makefile
blob: dee91fccc0a36217611baae53ecaa0646102b4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# (C) Copyright 2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# (C) Copyright 2000
# Murray Jensen <Murray.Jensen@csiro.au>
#
# 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))

#
# Use native tools and options
#
HOSTCPPFLAGS = -I$(BFD_ROOT_DIR)/include

HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')

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

#########################################################################

# defines $(obj).depend target
include $(SRCTREE)/rules.mk

sinclude $(obj).depend

#########################################################################

endif	# cygwin