Makefile.fpc 3.2 KB

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