Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # (C) Copyright 2000
  3. # Murray Jensen <Murray.Jensen@cmst.csiro.au>
  4. #
  5. # See file CREDITS for list of people who contributed to this
  6. # project.
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public License as
  10. # published by the Free Software Foundation; either version 2 of
  11. # the License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. # MA 02111-1307 USA
  22. #
  23. include $(TOPDIR)/config.mk
  24. BINS = gdbsend gdbcont
  25. ifneq ($(HOSTOS),HP-UX)
  26. BINS+= astest
  27. endif
  28. OBJS = gdbsend.o gdbcont.o astest.o error.o remote.o serial.o
  29. #
  30. # Use native tools and options
  31. #
  32. CPPFLAGS = -I$(BFD_ROOT_DIR)/include
  33. CFLAGS = $(HOST_CFLAGS) -O $(CPPFLAGS)
  34. CC = $(HOSTCC)
  35. MAKEDEPEND = makedepend
  36. HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')
  37. ifeq ($(HOSTOS),cygwin)
  38. all:
  39. .depend:
  40. else # ! CYGWIN
  41. all: $(BINS)
  42. gdbsend: gdbsend.o error.o remote.o serial.o
  43. $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
  44. gdbcont: gdbcont.o error.o remote.o serial.o
  45. $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
  46. astest: astest.o error.o
  47. $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ -L$(BFD_ROOT_DIR)/lib -lbfd -liberty
  48. clean:
  49. rm -f $(OBJS)
  50. distclean: clean
  51. rm -f $(BINS) core *.bak .depend
  52. #########################################################################
  53. .depend: Makefile $(OBJS:.o=.c)
  54. $(CC) -M $(CPPFLAGS) -I../include $(OBJS:.o=.c) > $@
  55. -include .depend
  56. #########################################################################
  57. endif # cygwin