Makefile.fpc 3.6 KB

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