Makefile.fpc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #
  2. # Makefile.fpc for Free Pascal GDB Interface
  3. #
  4. [package]
  5. name=gdbint
  6. version=1.0.5
  7. [target]
  8. units=gdbint gdbcon
  9. examples=testgdb symify
  10. [compiler]
  11. objectdir=libgdb/$(OS_TARGET)
  12. librarydir=libgdb/$(OS_TARGET)
  13. [require]
  14. libc=y
  15. [install]
  16. fpcpackage=y
  17. [default]
  18. fpcdir=../..
  19. [rules]
  20. # For unix be sure to use the locally created gdbver
  21. ifdef inUnix
  22. CURRDIR=./
  23. else
  24. CURRDIR=
  25. endif
  26. GDBLIBDIR+=libgdb/$(OS_TARGET)
  27. ifeq ($(OS_TARGET),go32v2)
  28. ifneq ($(DJDIR),)
  29. GDBLIBDIR+=$(DJDIR)/lib
  30. endif
  31. endif
  32. # Detect if libgdb.a is available
  33. override LIBGDB:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  34. ifeq ($(LIBGDB),)
  35. GDBFOUND=0
  36. else
  37. GDBFOUND=1
  38. endif
  39. ifeq ($(GDBFOUND),1)
  40. # libgdb.a found
  41. $(CURRDIR)getver$(EXEEXT) : gdbver.pp
  42. $(COMPILER) -o$(CURRDIR)getver$(EXEEXT) gdbver.pp
  43. ifndef GOTGDBVER
  44. # gdbver doesn't exists, build it first
  45. gdbint$(PPUEXT): $(CURRDIR)gdbver$(EXEEXT)
  46. $(MAKE) gdbint$(PPUEXT) GOTGDBVER=1
  47. else
  48. # gdbver exists
  49. GDBVER:=GDB_V$(strip $(shell $(CURRDIR)gdbver$(EXEEXT) -n))
  50. gdbint$(PPUEXT): gdbint.pp
  51. @$(ECHO) Using GDB $(GDBVER)
  52. $(COMPILER) -d$(GDBVER) gdbint.pp
  53. $(DEL) gdbver$(EXEEXT) gdbver$(OEXT)
  54. endif
  55. else
  56. # libgdb.a not found, default to libgdb v5
  57. GDBVER=GDB_V5
  58. gdbint$(PPUEXT): gdbint.pp
  59. @$(ECHO) libgdb.a not found, using default GDB $(GDBVER)
  60. $(COMPILER) -d$(GDBVER) gdbint.pp
  61. endif
  62. gdbcon$(PPUEXT): gdbcon.pp gdbint$(PPUEXT)
  63. ifeq ($(OS_TARGET),go32v2)
  64. DBGCOM=dbgcom$(OEXT)
  65. else
  66. DBGCOM=
  67. endif
  68. ifdef $(COMPILEDBGCOM)
  69. # FPC conditionnal remove the file watching mecanism introduced
  70. # in v2.02 of dbgcom.c because it relies
  71. # on the fact that all files are opened via C lib calls
  72. # which is wrong for FPC !!
  73. $(DBGCOM): ../v4.16/dbgcom.c
  74. gcc -c -DFPC -Dother_sel -gstabs -o dbgcom.o -I../v4.16 ../v4.16/dbgcom.c
  75. else
  76. $(DBGCOM):
  77. endif
  78. simple: $(DBGCOM)
  79. -rm gdbint.ppu
  80. ppc386 -dUSE_LIBGDB gdbint
  81. ppc386 testgdb
  82. testgdb$(EXEEXT): testgdb.pp gdbint$(PPUEXT) gdbcon$(PPUEXT) $(DBGCOM)
  83. # Allow test for example
  84. .PHONY: test
  85. test: examples
  86. clean: fpc_clean
  87. $(DEL) gdbver$(EXEEXT) gdbver$(OEXT)