2
0

Makefile.fpc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #
  2. # $Id: Makefile.fpc,v 1.32 2005/05/05 12:59:59 peter Exp $
  3. #
  4. # Makefile.fpc for FP IDE
  5. #
  6. [package]
  7. name=ide
  8. version=2.0.0
  9. [target]
  10. dirs=compiler
  11. programs=fp
  12. rst=fpstrings
  13. [install]
  14. datadir=$(INSTALL_BASEDIR)/ide
  15. fpcpackage=y
  16. [compiler]
  17. options=-Sg
  18. [require]
  19. packages=fv gdbint regexpr
  20. libc=y
  21. [default]
  22. fpcdir=..
  23. [prerules]
  24. #
  25. # Automatic detection if libgdb.a is present
  26. #
  27. ifndef NOGDB
  28. # Try to find GDB library
  29. # Look for a valid GDBLIBDIR environment variable
  30. ifdef GDBLIBDIR
  31. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  32. endif
  33. # Use default dirs if not available
  34. ifeq ($(LIBGDBFILE),)
  35. # Default locations <target>/<cpu> (linux) or <target> (win32,go32v2) only
  36. override GDBLIBDIR=$(wildcard $(FPCDIR)/libgdb/$(OS_TARGET)/$(CPU_TARGET))
  37. ifeq ($(GDBLIBDIR),)
  38. override GDBLIBDIR=$(FPCDIR)/libgdb/$(OS_TARGET)
  39. endif
  40. # Detect if libgdb.a is available
  41. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  42. endif
  43. # Disable GDB when no libgdb.a found
  44. ifeq ($(LIBGDBFILE),)
  45. GDB=
  46. else
  47. GDB=1
  48. endif
  49. ifdef GDB
  50. # The gdbint is already included due the gdbint package dependency
  51. override LIBDIR+=$(GDBLIBDIR)
  52. endif
  53. else
  54. # Disable
  55. GDB=
  56. endif #NOGDB
  57. [rules]
  58. .PHONY: compilerunits compilerclean \
  59. nogdb gdb all \
  60. clean_compiler clean testgdb postgdbinfo
  61. clean: fpc_cleanall
  62. distclean: clean compilerclean
  63. #
  64. # GDB detection
  65. #
  66. ifndef NOGDB
  67. ifdef GDB
  68. testgdb:
  69. @$(ECHO) LibGDB found in $(LIBGDBFILE)
  70. postgdbinfo:
  71. @$(ECHO) LibGDB was found, IDE has Debugger support
  72. else
  73. override COMPILER+=-dNODEBUG
  74. testgdb:
  75. @$(ECHO) LibGDB not found
  76. @$(ECHO) LIBGDBFILE=$(LIBGDBFILE)
  77. @$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
  78. @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
  79. postgdbinfo:
  80. @$(ECHO) LibGDB was not found, IDE has no Debugger support
  81. endif
  82. else
  83. testgdb:
  84. @$(ECHO) Building without Debugger
  85. postgdbinfo:
  86. @$(ECHO) Debugger disabled, IDE has no Debugger support
  87. override COMPILER+=-dNODEBUG
  88. endif # NOGDB
  89. #
  90. # Compiler
  91. #
  92. compilerunits : compiler/$(FPCMADE)
  93. compiler/$(FPCMADE):
  94. $(MAKE) -C compiler all
  95. compilerclean :
  96. $(MAKE) -C compiler clean
  97. #
  98. # Build targets
  99. #
  100. # building happends in 2 steps, first the packages, compiler
  101. # dirs are build. In the second step the IDE is build. This is
  102. # required because it needs to detect which compiler version
  103. # to use.
  104. #
  105. fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
  106. buildfp:
  107. $(MAKE) compilerunits
  108. $(MAKE) testgdb
  109. $(MAKE) fpc_all
  110. $(MAKE) postgdbinfo
  111. gdb:
  112. $(MAKE) -C ../packages/base/gdbint
  113. $(MAKE) buildfp
  114. nogdb:
  115. $(MAKE) buildfp NOGDB=1
  116. #
  117. # Default targets
  118. #
  119. # By default we try to create the ide with full debugging support,
  120. all: gdb
  121. # This is necessary because we don't have all units separate in the
  122. # units targets
  123. clean: cleanall
  124. #
  125. # Installation
  126. #
  127. ifndef UNIXHier
  128. override INSTALL_DATADIR=$(INSTALL_BINDIR)
  129. endif
  130. install: fpc_install
  131. $(MKDIR) $(INSTALL_DATADIR)
  132. $(MKDIR) $(INSTALL_DOCDIR)
  133. $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
  134. ifeq ($(OS_TARGET),win32)
  135. $(INSTALL) fp32.ico $(INSTALL_DATADIR)
  136. endif
  137. $(INSTALL) readme.ide $(INSTALL_DOCDIR)
  138. #
  139. # Misc
  140. #
  141. clean_compiler:
  142. $(MAKE) -C compiler clean
  143. $(MAKE) -C ../compiler ppuclean