xref: /openbmc/u-boot/tools/gdb/Makefile (revision 3765b3e7)
1#
2# (C) Copyright 2006
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# (C) Copyright 2000
6# Murray Jensen <Murray.Jensen@csiro.au>
7#
8# SPDX-License-Identifier:	GPL-2.0+
9#
10
11include $(TOPDIR)/config.mk
12
13BINS	= gdbsend gdbcont
14
15COBJS	= gdbsend.o gdbcont.o error.o remote.o serial.o
16
17HOSTOBJS := $(addprefix $(obj),$(COBJS))
18HOSTSRCS := $(COBJS:.o=.c)
19BINS	:= $(addprefix $(obj),$(BINS))
20
21#
22# Use native tools and options
23#
24HOSTCPPFLAGS = -I$(BFD_ROOT_DIR)/include
25
26HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')
27
28ifeq ($(HOSTOS),cygwin)
29
30all:
31$(obj).depend:
32
33else	# ! CYGWIN
34
35all:	$(obj).depend $(BINS)
36
37$(obj)gdbsend:	$(obj)gdbsend.o $(obj)error.o $(obj)remote.o $(obj)serial.o
38		$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
39
40$(obj)gdbcont:	$(obj)gdbcont.o $(obj)error.o $(obj)remote.o $(obj)serial.o
41		$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
42
43clean:
44	rm -f $(HOSTOBJS)
45
46distclean:	clean
47	rm -f $(BINS) $(obj)core $(obj)*.bak $(obj).depend
48
49#########################################################################
50
51# defines $(obj).depend target
52include $(SRCTREE)/rules.mk
53
54sinclude $(obj).depend
55
56#########################################################################
57
58endif	# cygwin
59