Makefile.fpc 4.9 KB

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