Makefile.fpc 4.6 KB

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