2
0

Makefile.fpc 3.1 KB

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