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