2
0

Makefile.fpc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.5.1
  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 chm
  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. # No custom libgdb.a found, try using system default library if available
  53. ifeq ($(LIBGDBFILE),)
  54. SYSLIBDIR=/lib /usr/lib /usr/local/lib
  55. # Detect if libgdb.a is available
  56. override LIBGDBFILE=$(firstword $(wildcard $(addsuffix /libgdb.a,$(SYSLIBDIR))))
  57. ifneq (${LIBGDBFILE},)
  58. $(warning Using system sefault libgdb file located in ${LIBGDBFILE})
  59. GDBLIBDIR=$(dir ${LIBGDBFILE})
  60. endif
  61. endif
  62. # Disable GDB when no libgdb.a found
  63. ifeq ($(LIBGDBFILE),)
  64. GDB=
  65. else
  66. GDB=1
  67. endif
  68. ifdef GDB
  69. # The gdbint is already included due the gdbint package dependency
  70. override LIBDIR+=$(GDBLIBDIR)
  71. endif
  72. else
  73. # Disable
  74. GDB=
  75. endif #NOGDB
  76. [rules]
  77. .NOTPARALLEL:
  78. .PHONY: compilerunits compilerclean \
  79. nogdb gdb all \
  80. clean_compiler clean testgdb postgdbinfo
  81. clean: fpc_cleanall
  82. distclean: clean compilerclean
  83. #
  84. # GDB detection
  85. #
  86. ifndef NOGDB
  87. ifdef GDB
  88. testgdb:
  89. @$(ECHO) LibGDB found in $(LIBGDBFILE)
  90. postgdbinfo:
  91. @$(ECHO) LibGDB was found, IDE has Debugger support
  92. else
  93. override COMPILER+=-dNODEBUG
  94. testgdb:
  95. @$(ECHO) LibGDB not found
  96. @$(ECHO) LIBGDBFILE=$(LIBGDBFILE)
  97. @$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
  98. @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
  99. postgdbinfo:
  100. @$(ECHO) LibGDB was not found, IDE has no Debugger support
  101. endif
  102. else
  103. testgdb:
  104. @$(ECHO) Building without Debugger
  105. postgdbinfo:
  106. @$(ECHO) Debugger disabled, IDE has no Debugger support
  107. override COMPILER+=-dNODEBUG
  108. endif # NOGDB
  109. #
  110. # Compiler
  111. #
  112. compilerunits : compiler/$(FPCMADE)
  113. compiler/$(FPCMADE):
  114. $(MAKE) -C compiler all
  115. compilerclean :
  116. $(MAKE) -C compiler clean
  117. #
  118. # Build targets
  119. #
  120. # building happends in 2 steps, first the packages, compiler
  121. # dirs are build. In the second step the IDE is build. This is
  122. # required because it needs to detect which compiler version
  123. # to use.
  124. #
  125. fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
  126. buildfp:
  127. $(MAKE) compilerunits
  128. $(MAKE) testgdb
  129. $(MAKE) fpc_all
  130. $(MAKE) postgdbinfo
  131. gdb:
  132. # $(MAKE) -C ../packages/base/gdbint
  133. $(MAKE) buildfp
  134. nogdb:
  135. $(MAKE) buildfp NOGDB=1
  136. #
  137. # Default targets
  138. #
  139. # By default we try to create the ide with full debugging support,
  140. all: gdb
  141. # This is necessary because we don't have all units separate in the
  142. # units targets
  143. clean: cleanall
  144. #
  145. # Installation
  146. #
  147. ifndef UNIXHier
  148. override INSTALL_DATADIR=$(INSTALL_BINDIR)
  149. endif
  150. install: fpc_install
  151. $(MKDIR) $(INSTALL_DATADIR)
  152. $(MKDIR) $(INSTALL_DOCDIR)
  153. $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
  154. ifeq ($(OS_TARGET),win32)
  155. $(INSTALL) fp32.ico $(INSTALL_DATADIR)
  156. endif
  157. $(INSTALL) readme.ide $(INSTALL_DOCDIR)
  158. #
  159. # Misc
  160. #
  161. clean_compiler:
  162. $(MAKE) -C compiler clean
  163. $(MAKE) -C ../compiler ppuclean