Makefile.fpc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.0.0
  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. packages_go32v2=graph
  21. libc=y
  22. [default]
  23. fpcdir=..
  24. [prerules]
  25. #
  26. # Automatic detection if libgdb.a is present
  27. #
  28. ifndef NOGDB
  29. # Try to find GDB library
  30. # Look for a valid GDBLIBDIR environment variable
  31. ifdef GDBLIBDIR
  32. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  33. endif
  34. # Use default dirs if not available
  35. ifeq ($(LIBGDBFILE),)
  36. # Default locations <target>/<cpu> (linux) or <target> (win32,go32v2) only
  37. override GDBLIBDIR=$(wildcard $(FPCDIR)/libgdb/$(OS_TARGET)/$(CPU_TARGET))
  38. ifeq ($(GDBLIBDIR),)
  39. override GDBLIBDIR=$(FPCDIR)/libgdb/$(OS_TARGET)
  40. endif
  41. # Detect if libgdb.a is available
  42. override LIBGDBFILE:=$(firstword $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR))))
  43. endif
  44. # Disable GDB when no libgdb.a found
  45. ifeq ($(LIBGDBFILE),)
  46. GDB=
  47. else
  48. GDB=1
  49. endif
  50. ifdef GDB
  51. # The gdbint is already included due the gdbint package dependency
  52. override LIBDIR+=$(GDBLIBDIR)
  53. endif
  54. else
  55. # Disable
  56. GDB=
  57. endif #NOGDB
  58. [rules]
  59. .NOTPARALLEL:
  60. .PHONY: compilerunits compilerclean \
  61. nogdb gdb all \
  62. clean_compiler clean testgdb postgdbinfo
  63. clean: fpc_cleanall
  64. distclean: clean compilerclean
  65. #
  66. # GDB detection
  67. #
  68. ifndef NOGDB
  69. ifdef GDB
  70. testgdb:
  71. @$(ECHO) LibGDB found in $(LIBGDBFILE)
  72. postgdbinfo:
  73. @$(ECHO) LibGDB was found, IDE has Debugger support
  74. else
  75. override COMPILER+=-dNODEBUG
  76. testgdb:
  77. @$(ECHO) LibGDB not found
  78. @$(ECHO) LIBGDBFILE=$(LIBGDBFILE)
  79. @$(ECHO) GDBLIBDIR=$(GDBLIBDIR)
  80. @$(ECHO) $(wildcard $(addsuffix /libgdb.a,$(GDBLIBDIR)))
  81. postgdbinfo:
  82. @$(ECHO) LibGDB was not found, IDE has no Debugger support
  83. endif
  84. else
  85. testgdb:
  86. @$(ECHO) Building without Debugger
  87. postgdbinfo:
  88. @$(ECHO) Debugger disabled, IDE has no Debugger support
  89. override COMPILER+=-dNODEBUG
  90. endif # NOGDB
  91. #
  92. # Compiler
  93. #
  94. compilerunits : compiler/$(FPCMADE)
  95. compiler/$(FPCMADE):
  96. $(MAKE) -C compiler all
  97. compilerclean :
  98. $(MAKE) -C compiler clean
  99. #
  100. # Build targets
  101. #
  102. # building happends in 2 steps, first the packages, compiler
  103. # dirs are build. In the second step the IDE is build. This is
  104. # required because it needs to detect which compiler version
  105. # to use.
  106. #
  107. fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
  108. buildfp:
  109. $(MAKE) compilerunits
  110. $(MAKE) testgdb
  111. $(MAKE) fpc_all
  112. $(MAKE) postgdbinfo
  113. gdb:
  114. # $(MAKE) -C ../packages/base/gdbint
  115. $(MAKE) buildfp
  116. nogdb:
  117. $(MAKE) buildfp NOGDB=1
  118. #
  119. # Default targets
  120. #
  121. # By default we try to create the ide with full debugging support,
  122. all: gdb
  123. # This is necessary because we don't have all units separate in the
  124. # units targets
  125. clean: cleanall
  126. #
  127. # Installation
  128. #
  129. ifndef UNIXHier
  130. override INSTALL_DATADIR=$(INSTALL_BINDIR)
  131. endif
  132. install: fpc_install
  133. $(MKDIR) $(INSTALL_DATADIR)
  134. $(MKDIR) $(INSTALL_DOCDIR)
  135. $(INSTALL) fp.ans $(wildcard *.pt) $(wildcard *.tdf) $(INSTALL_DATADIR)
  136. ifeq ($(OS_TARGET),win32)
  137. $(INSTALL) fp32.ico $(INSTALL_DATADIR)
  138. endif
  139. $(INSTALL) readme.ide $(INSTALL_DOCDIR)
  140. #
  141. # Misc
  142. #
  143. clean_compiler:
  144. $(MAKE) -C compiler clean
  145. $(MAKE) -C ../compiler ppuclean