Makefile.fpc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #
  2. # Makefile.fpc for Free Pascal Tests directory
  3. #
  4. [default]
  5. fpcdir=..
  6. rule=allexectests
  7. [rules]
  8. # Unix like OS ?
  9. ifeq ($(OS_TARGET),linux)
  10. INUNIX=1
  11. endif
  12. ifeq ($(OS_TARGET),freebsd)
  13. INUNIX=1
  14. endif
  15. # For linux by default no graph tests
  16. ifdef INUNIX
  17. NOGRAPH=1
  18. endif
  19. #
  20. # Tools
  21. #
  22. ifndef FAILLIST
  23. export FAILLIST:=faillist
  24. endif
  25. ifndef LONGLOG
  26. export LONGLOG:=longlog
  27. endif
  28. ifndef LOG
  29. export LOG:=log
  30. endif
  31. units : units/$(FPCMADE)
  32. units/$(FPCMADE):
  33. $(MAKE) -C units
  34. DOTEST=dotest$(EXEEXT)
  35. $(DOTEST) : units utils/dotest.pp utils/redir.pp
  36. $(FPC) -Fuunits -FE. utils/dotest
  37. testcheck: units $(DOTEST)
  38. #
  39. # Dotest options
  40. #
  41. ifneq ($(FPC),ppc386$(EXEEXT))
  42. override DOTESTOPT+=-c$(FPC)
  43. endif
  44. ifdef GRAPH
  45. override DOTESTOPT+=-g
  46. endif
  47. ifdef INTERACTIVE
  48. override DOTESTOPT+=-i
  49. endif
  50. #
  51. # Test run targets
  52. #
  53. DIRS=webtbs webtbf tbs tbf test testopt
  54. %.log : %.pp
  55. $(DOTEST) $(DOTESTOPT) $<
  56. %.elg : %.pp
  57. $(DOTEST) $(DOTESTOPT) -e $<
  58. #
  59. # Compile tests
  60. #
  61. .PHONY: alltbs alltbf allwebtbs allwebtbf alltest alltestopt alltests
  62. alltbs : testcheck $(patsubst %.pp,%.log,$(wildcard tbs/t*.pp))
  63. alltbf : testcheck $(patsubst %.pp,%.log,$(wildcard tbf/t*.pp))
  64. allwebtbs : testcheck $(patsubst %.pp,%.log,$(wildcard webtbs/t*.pp))
  65. allwebtbf : testcheck $(patsubst %.pp,%.log,$(wildcard webtbf/t*.pp))
  66. alltest : testcheck $(patsubst %.pp,%.log,$(wildcard test/t*.pp))
  67. alltestopt : testcheck $(patsubst %.pp,%.log,$(wildcard testopt/t*.pp))
  68. alltests: alltest alltbs alltbf allwebtbs allwebtbf
  69. #
  70. # Compile and Run tests
  71. #
  72. .PHONY: allexectbs allexectbf allexecwebtbs allexecwebtbf allexectest allexectestopt allexectests
  73. allexectbs : testcheck $(patsubst %.pp,%.elg,$(wildcard tbs/t*.pp))
  74. allexectbf : testcheck $(patsubst %.pp,%.elg,$(wildcard tbf/t*.pp))
  75. allexecwebtbs : testcheck $(patsubst %.pp,%.elg,$(wildcard webtbs/t*.pp))
  76. allexecwebtbf : testcheck $(patsubst %.pp,%.elg,$(wildcard webtbf/t*.pp))
  77. allexectest : testcheck $(patsubst %.pp,%.elg,$(wildcard test/t*.pp))
  78. allexectestopt : testcheck $(patsubst %.pp,%.elg,$(wildcard testopt/t*.pp))
  79. allexectests: allexectest allexectbs allexectbf allexecwebtbs allexecwebtbf
  80. #
  81. # Clean
  82. #
  83. .PHONY: clean distclean
  84. clean:
  85. -rm -f $(addsuffix /*$(PPUEXT),$(DIRS))
  86. -rm -f $(addsuffix /*$(OEXT),$(DIRS))
  87. -rm -f $(addsuffix /*.rst,$(DIRS))
  88. -rm -f $(addsuffix /*$(SHAREDLIBEXT),$(DIRS))
  89. -rm -f $(addsuffix /*.log,$(DIRS))
  90. -rm -f $(addsuffix /*.elg,$(DIRS))
  91. ifdef INUNIX
  92. -rm -f $(wildcard $(patsubst %.pp,%$(EXEEXT),$(wildcard $(addsuffix /t*.pp,$(DIRS)))))
  93. else
  94. -rm -f $(addsuffix /*$(EXEEXT),$(DIRS))
  95. endif
  96. -rm -f *.tmp core
  97. -rm -f $(LOG) $(LONGLOG) $(FAILLIST)
  98. -rm -f ppas.sh ppas.bat gmon.out
  99. distclean: clean
  100. -rm -f dotest$(EXEEXT) dotest$(OEXT) redir$(PPUEXT) redir$(OEXT)
  101. $(MAKE) -C units clean
  102. #
  103. # Main rules
  104. #
  105. .PHONY: all full
  106. all : allexectests
  107. full : clean allexectests
  108. info :
  109. @echo This Makefile allows to test the compiler
  110. @echo
  111. @echo Targets:
  112. @echo all - continue all tests
  113. @echo full - clean and run all tests
  114. @echo