blob: dee91fccc0a36217611baae53ecaa0646102b4f0 [file] [log] [blame]
wdenkd84c5582002-01-27 00:56:55 +00001#
Marian Balakowiczf9328632006-09-01 19:49:50 +02002# (C) Copyright 2006
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
wdenkd84c5582002-01-27 00:56:55 +00005# (C) Copyright 2000
Wolfgang Denkb3b0fd52005-08-12 23:20:59 +02006# Murray Jensen <Murray.Jensen@csiro.au>
wdenkd84c5582002-01-27 00:56:55 +00007#
Wolfgang Denk1a459662013-07-08 09:37:19 +02008# SPDX-License-Identifier: GPL-2.0+
wdenkd84c5582002-01-27 00:56:55 +00009#
10
11include $(TOPDIR)/config.mk
12
13BINS = gdbsend gdbcont
14
Marian Balakowiczf9328632006-09-01 19:49:50 +020015COBJS = gdbsend.o gdbcont.o error.o remote.o serial.o
16
Scott Woodd984fed2009-11-04 18:41:41 -060017HOSTOBJS := $(addprefix $(obj),$(COBJS))
18HOSTSRCS := $(COBJS:.o=.c)
Marian Balakowiczf9328632006-09-01 19:49:50 +020019BINS := $(addprefix $(obj),$(BINS))
wdenkd84c5582002-01-27 00:56:55 +000020
21#
22# Use native tools and options
23#
Scott Woodd984fed2009-11-04 18:41:41 -060024HOSTCPPFLAGS = -I$(BFD_ROOT_DIR)/include
wdenkd84c5582002-01-27 00:56:55 +000025
26HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')
27
28ifeq ($(HOSTOS),cygwin)
29
30all:
Wolfgang Denk184f1b42008-07-11 22:55:31 +020031$(obj).depend:
wdenkd84c5582002-01-27 00:56:55 +000032
33else # ! CYGWIN
34
Marian Balakowiczf9328632006-09-01 19:49:50 +020035all: $(obj).depend $(BINS)
wdenkd84c5582002-01-27 00:56:55 +000036
Marian Balakowiczf9328632006-09-01 19:49:50 +020037$(obj)gdbsend: $(obj)gdbsend.o $(obj)error.o $(obj)remote.o $(obj)serial.o
Scott Woodd984fed2009-11-04 18:41:41 -060038 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
wdenkd84c5582002-01-27 00:56:55 +000039
Marian Balakowiczf9328632006-09-01 19:49:50 +020040$(obj)gdbcont: $(obj)gdbcont.o $(obj)error.o $(obj)remote.o $(obj)serial.o
Scott Woodd984fed2009-11-04 18:41:41 -060041 $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
wdenkd84c5582002-01-27 00:56:55 +000042
wdenkd84c5582002-01-27 00:56:55 +000043clean:
Scott Woodd984fed2009-11-04 18:41:41 -060044 rm -f $(HOSTOBJS)
wdenkd84c5582002-01-27 00:56:55 +000045
46distclean: clean
Marian Balakowiczf9328632006-09-01 19:49:50 +020047 rm -f $(BINS) $(obj)core $(obj)*.bak $(obj).depend
wdenkd84c5582002-01-27 00:56:55 +000048
49#########################################################################
50
Marian Balakowiczf9328632006-09-01 19:49:50 +020051# defines $(obj).depend target
52include $(SRCTREE)/rules.mk
wdenkd84c5582002-01-27 00:56:55 +000053
Marian Balakowiczf9328632006-09-01 19:49:50 +020054sinclude $(obj).depend
wdenkd84c5582002-01-27 00:56:55 +000055
56#########################################################################
57
58endif # cygwin