Makefile.fpc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. #
  2. # $Id$
  3. #
  4. # Makefile.fpc for FP IDE
  5. #
  6. [package]
  7. name=ide
  8. version=1.9.0
  9. [target]
  10. dirs=compiler fakegdb
  11. programs=fp
  12. rst=fpstrings
  13. [install]
  14. datadir=$(INSTALL_BASEDIR)/ide
  15. fpcpackage=y
  16. [compiler]
  17. options=-Sg
  18. targetdir=.
  19. unitdir=compiler
  20. [require]
  21. packages=fv gdbint regexpr
  22. [default]
  23. fpcdir=..
  24. [prerules]
  25. #
  26. # Linux->Unix transistion fix
  27. #
  28. ifeq ($(OS_TARGET),linux)
  29. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  30. override FPCOPT+=-dUNIX
  31. endif
  32. endif
  33. ifeq ($(OS_TARGET),freebsd)
  34. ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
  35. override FPCOPT+=-dUNIX
  36. endif
  37. endif
  38. #
  39. # Automatic detection of the compiler version
  40. #
  41. # compilers 1.0.x need to define COMPILER_1_0.
  42. #
  43. # To detect 1.0.x compilers we look for finput.ppu. If this unit
  44. # is not found then we include 1.0.x compiler
  45. #
  46. ifeq ($(wildcard compiler/finput.*),)
  47. override FPCOPT+=-dCOMPILER_1_0
  48. endif
  49. #
  50. # Automatic detection if libgdb.a is present
  51. #
  52. # when including debugger include the gdbinterface
  53. ifndef GDBINT
  54. GDBINT=gdbint
  55. endif
  56. # Try to find GDB library
  57. ifeq ($(GDB),1)
  58. ifeq ($(DEBUG),1)
  59. # First test if a debug version exists in a specific dir
  60. ifneq ($(strip $(wildcard $(addsuffix /$(GDBINT)/libgdb/d$(OS_TARGET)/libgdb.a,$(PACKAGESDIR)))),)
  61. OSGDBDIR=d$(OS_TARGET)
  62. else
  63. OSGDBDIR=$(OS_TARGET)
  64. endif
  65. else
  66. OSGDBDIR=$(OS_TARGET)
  67. endif
  68. GDBLIBDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR)))
  69. GDBOBJDIR+=$(wildcard $(addsuffix /$(GDBINT)/libgdb/$(OSGDBDIR),$(PACKAGESDIR)))
  70. ifeq ($(OS_TARGET),go32v2)
  71. ifneq ($(DJDIR),)
  72. GDBLIBDIR+=$(DJDIR)/lib
  73. endif
  74. endif
  75. ifeq ($(strip $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))),)
  76. override GDB=0
  77. GDBFOUND=0
  78. else
  79. override LIBGDB=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  80. GDBFOUND=1
  81. endif
  82. endif
  83. ifeq ($(GDB),1)
  84. # The gdbint is already included due the gdbint package dependency
  85. override LIBDIR+=$(GDBLIBDIR)
  86. else
  87. override UNITDIR+=fakegdb
  88. endif
  89. [rules]
  90. .PHONY: compilerunits compilerclean \
  91. nogdb gdb all \
  92. clean_compiler clean testgdb postgdbinfo
  93. clean: fpc_cleanall
  94. distclean: clean compilerclean
  95. #
  96. # FVision or old FV detection
  97. #
  98. ifneq ($(wildcard $(UNITDIR_FV)/fvconsts$(PPUEXT)),)
  99. override COMPILER+=-dFVISION
  100. endif
  101. ifeq ($(GDB),1)
  102. ifneq ($(GDBFOUND),0)
  103. override COMPILER+=-dWITH_GDB
  104. endif
  105. endif
  106. fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
  107. testgdb:
  108. ifneq ($(GDBFOUND),0)
  109. @$(ECHO) LibGDB found in $(LIBGDB)
  110. else
  111. @$(ECHO) LibGDB not found
  112. @$(ECHO) LIBGDB=$(LIBGDB)
  113. @$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
  114. @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
  115. endif
  116. postgdbinfo:
  117. ifeq ($(GDBFOUND),0)
  118. @$(ECHO) LibGDB was not found, IDE has no Debugger support
  119. endif
  120. #
  121. # Compiler
  122. #
  123. compilerunits : compiler/$(FPCMADE)
  124. compiler/$(FPCMADE):
  125. $(MAKE) -C compiler all
  126. compilerclean :
  127. $(MAKE) -C compiler clean
  128. #
  129. # Fake GDB
  130. #
  131. fakegdbunits : fakegdb/$(FPCMADE)
  132. fakegdb/$(FPCMADE):
  133. $(MAKE) -C fakegdb all
  134. fakegdbclean :
  135. $(MAKE) -C fakegdb clean
  136. fakegdbinfo:
  137. @$(ECHO) Using FakeGDB, IDE has no Debugger support
  138. #
  139. # Build targets
  140. #
  141. # building happends in 2 steps, first the packages, compiler and fakegdb
  142. # dirs are build. In the second step the IDE is build. This is
  143. # required because it needs to detect which compiler version
  144. # to use.
  145. #
  146. builddirs: compilerunits fakegdbunits
  147. buildfp: fpc_all
  148. gdb:
  149. $(MAKE) builddirs
  150. $(MAKE) testgdb buildfp postgdbinfo GDB=1
  151. nogdb:
  152. $(MAKE) builddirs
  153. $(MAKE) buildfp fakegdbinfo
  154. #
  155. # Default targets
  156. #
  157. # By default we try to create the ide with full debugging support,
  158. # if gdbint and libgdb is not available it will fallback to use
  159. # fakegdb
  160. all: gdb
  161. # This is necessary because we don't have all units separate in the
  162. # units targets
  163. clean: cleanall
  164. #
  165. # Installation
  166. #
  167. ifndef UNIXINSTALLDIR
  168. override INSTALL_DATADIR=$(INSTALL_BINDIR)
  169. endif
  170. install: fpc_install
  171. $(MKDIR) $(INSTALL_DATADIR)
  172. $(MKDIR) $(INSTALL_DOCDIR)
  173. $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
  174. ifeq ($(OS_TARGET),win32)
  175. $(INSTALL) fp32.ico $(INSTALL_DATADIR)
  176. endif
  177. $(INSTALL) readme.ide $(INSTALL_DOCDIR)
  178. #
  179. # Misc
  180. #
  181. clean_compiler:
  182. $(MAKE) -C compiler clean
  183. $(MAKE) -C ../compiler ppuclean
  184. #
  185. # $Log$
  186. # Revision 1.18 2003-11-01 22:45:29 marco
  187. # * updated package version
  188. #
  189. # Revision 1.17 2003/10/03 17:29:13 florian
  190. # + id and log added
  191. #
  192. #