Makefile.fpc 3.3 KB

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