Makefile.fpc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #
  2. # $Id$
  3. #
  4. # Makefile.fpc for FP IDE
  5. #
  6. [package]
  7. name=ide
  8. version=1.9.7
  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. libc=y
  21. [default]
  22. fpcdir=..
  23. [prerules]
  24. #
  25. # Automatic detection if libgdb.a is present
  26. #
  27. ifndef NOGDB
  28. # Try to find GDB library
  29. # Look for a valid GDBLIBDIR environment variable
  30. ifdef GDBLIBDIR
  31. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  32. endif
  33. # Use default dirs if not available
  34. ifeq ($(LIBGDBFILE),)
  35. # Default locations <target>/<cpu> (linux) or <target> (win32,go32v2) only
  36. override GDBLIBDIR=$(wildcard $(FPCDIR)/libgdb/$(OS_TARGET)/$(CPU_TARGET))
  37. ifeq ($(GDBLIBDIR),)
  38. override GDBLIBDIR=$(FPCDIR)/libgdb/$(OS_TARGET)
  39. endif
  40. # Detect if libgdb.a is available
  41. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  42. endif
  43. # Disable GDB when no libgdb.a found
  44. ifeq ($(LIBGDBFILE),)
  45. GDB=
  46. else
  47. GDB=1
  48. endif
  49. ifdef GDB
  50. # The gdbint is already included due the gdbint package dependency
  51. override LIBDIR+=$(GDBLIBDIR)
  52. endif
  53. else
  54. # Disable
  55. GDB=
  56. endif #NOGDB
  57. [rules]
  58. .PHONY: compilerunits compilerclean \
  59. nogdb gdb all \
  60. clean_compiler clean testgdb postgdbinfo
  61. clean: fpc_cleanall
  62. distclean: clean compilerclean
  63. #
  64. # GDB detection
  65. #
  66. ifndef NOGDB
  67. ifdef GDB
  68. testgdb:
  69. @$(ECHO) LibGDB found in $(LIBGDBFILE)
  70. postgdbinfo:
  71. @$(ECHO) LibGDB was found, IDE has Debugger support
  72. else
  73. override COMPILER+=-dNODEBUG
  74. testgdb:
  75. @$(ECHO) LibGDB not found
  76. @$(ECHO) LIBGDBFILE=$(LIBGDBFILE)
  77. @$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
  78. @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
  79. postgdbinfo:
  80. @$(ECHO) LibGDB was not found, IDE has no Debugger support
  81. endif
  82. else
  83. testgdb:
  84. @$(ECHO) Building without Debugger
  85. postgdbinfo:
  86. @$(ECHO) Debugger disabled, IDE has no Debugger support
  87. override COMPILER+=-dNODEBUG
  88. endif # NOGDB
  89. #
  90. # Compiler
  91. #
  92. compilerunits : compiler/$(FPCMADE)
  93. compiler/$(FPCMADE):
  94. $(MAKE) -C compiler all
  95. compilerclean :
  96. $(MAKE) -C compiler clean
  97. #
  98. # Build targets
  99. #
  100. # building happends in 2 steps, first the packages, compiler
  101. # dirs are build. In the second step the IDE is build. This is
  102. # required because it needs to detect which compiler version
  103. # to use.
  104. #
  105. fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
  106. buildfp:
  107. $(MAKE) compilerunits
  108. $(MAKE) testgdb
  109. $(MAKE) fpc_all
  110. $(MAKE) postgdbinfo
  111. gdb:
  112. $(MAKE) buildfp
  113. nogdb:
  114. $(MAKE) buildfp NOGDB=1
  115. #
  116. # Default targets
  117. #
  118. # By default we try to create the ide with full debugging support,
  119. all: gdb
  120. # This is necessary because we don't have all units separate in the
  121. # units targets
  122. clean: cleanall
  123. #
  124. # Installation
  125. #
  126. ifndef UNIXHier
  127. override INSTALL_DATADIR=$(INSTALL_BINDIR)
  128. endif
  129. install: fpc_install
  130. $(MKDIR) $(INSTALL_DATADIR)
  131. $(MKDIR) $(INSTALL_DOCDIR)
  132. $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
  133. ifeq ($(OS_TARGET),win32)
  134. $(INSTALL) fp32.ico $(INSTALL_DATADIR)
  135. endif
  136. $(INSTALL) readme.ide $(INSTALL_DOCDIR)
  137. #
  138. # Misc
  139. #
  140. clean_compiler:
  141. $(MAKE) -C compiler clean
  142. $(MAKE) -C ../compiler ppuclean
  143. #
  144. # $Log$
  145. # Revision 1.30 2005-01-10 22:49:56 armin
  146. # * updated makefile.fpc versions to 1.9.7, regenerated makefiles
  147. #
  148. # Revision 1.29 2004/12/30 20:57:39 hajny
  149. # * version 1.9.6
  150. #
  151. # Revision 1.28 2004/12/20 18:58:46 peter
  152. # * UnixHier
  153. #
  154. # Revision 1.27 2004/11/11 15:20:52 florian
  155. # * applied Peter's patch from yesterday
  156. #
  157. # Revision 1.26 2004/11/05 19:10:18 peter
  158. # * report where libgdb.a is found
  159. #
  160. # Revision 1.25 2004/11/05 13:25:10 peter
  161. # libgdb now will be search in fpcdir
  162. #
  163. # Revision 1.24 2004/11/05 12:48:45 peter
  164. # finding of libgdb.a updated
  165. #
  166. # Revision 1.23 2004/11/02 09:14:09 peter
  167. # * fix build with gdb
  168. #
  169. # Revision 1.22 2004/10/30 12:36:43 peter
  170. # * units are now created in separate directory units/cpu-os/
  171. # * distclean uses cleanall rule and removes units dir
  172. # * cross compile support fixed, it is now possible to cycle a ppcsparc
  173. # without deleting ppc386
  174. # * bintutilsperfix defaults to cpu-os-
  175. #
  176. # Revision 1.21 2004/05/30 09:15:35 florian
  177. # * first part of version number update
  178. #
  179. # Revision 1.20 2004/04/12 18:16:15 florian
  180. # * i386 compilation on debian biarch fixed
  181. #
  182. # Revision 1.19 2004/01/05 23:29:35 marco
  183. # * fixed a few makefiles version numbers
  184. #
  185. # Revision 1.18 2003/11/01 22:45:29 marco
  186. # * updated package version
  187. #
  188. # Revision 1.17 2003/10/03 17:29:13 florian
  189. # + id and log added
  190. #
  191. #