MPWMake 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # Make file for MPW make.
  2. # To run it, use:
  3. # Make <target> -f MPWMake > Makeout ; Makeout
  4. # where <target> should be replaced with actual make target.
  5. #Possible options:
  6. DOTEST = :utils:DoTest
  7. FPC = ppcppc
  8. #OPT
  9. TEST_FPC = ::compiler:ppcppc
  10. TEST_OS_TARGET = macos
  11. TEST_CPU_TARGET = powerpc
  12. TEST_FULL_TARGET = {TEST_CPU_TARGET}-{TEST_OS_TARGET}
  13. #TEST_OPT
  14. # Target dir where the ppu and binaries are created:
  15. TEST_OUTPUTDIR = :output:{TEST_FULL_TARGET}
  16. TESTSUBDIRS = : :cg: :cg:cdecl: :units:system: :units:dos: :units:crt: :units:objects: :units:strings: :units:sysutils: :units:math:
  17. DIRS = :webtbs: :webtbf: :tbs: :tbf: :test: :test:cg: :test:cg:cdecl: :test:units:system: :test:units:dos: :test:units:crt: :test:units:objects: :test:units:strings: :test:units:sysutils: :test:units:math:
  18. ################################
  19. # Utilities
  20. #
  21. :utils:dotest Ä :utils:dotest.pp
  22. "{FPC}" -WT "{OPT}" -FE:utils: :utils:dotest.pp
  23. :utils:digest Ä :utils:digest.pp
  24. "{FPC}" -WT "{OPT}" -FE:utils: :utils:digest.pp
  25. :utils:fail Ä :utils:fail.pp
  26. "{FPC}" -WT "{OPT}" -FE:utils: :utils:fail.pp
  27. :utils:testfail Ä :utils:testfail.pp
  28. "{FPC}" -WT "{OPT}" -FE:utils: :utils:testfail.pp
  29. utils Ä :utils:dotest :utils:digest :utils:fail :utils:testfail
  30. ################################
  31. # Units
  32. #
  33. units Ä
  34. Set TEMP_FPC `Files -f "{TEST_FPC}"`
  35. Directory :units:
  36. Make all -f MPWMake -d FPC={TEMP_FPC} -d OPT={TEST_OPT} > Makeout ; Makeout
  37. Directory ::
  38. ################################
  39. # Copy test environment dependent files ctest.o to test/cg etc
  40. #
  41. copyfiles Ä {TEST_OUTPUTDIR}
  42. Duplicate -y :test:cg:obj:{TEST_OS_TARGET}:{TEST_CPU_TARGET}:ctest.o :test:cg
  43. Set Exit 0
  44. NewFolder {TEST_OUTPUTDIR}:test
  45. NewFolder {TEST_OUTPUTDIR}:test:units
  46. NewFolder {TEST_OUTPUTDIR}:test:units:system
  47. Set Exit 1
  48. Duplicate -y :test:units:system:testÅ.txt {TEST_OUTPUTDIR}:test:units:system
  49. ################################
  50. # Preparation for tests
  51. #
  52. testprep Ä testprep-stamp.{TEST_FULL_TARGET}
  53. testprep-stamp.{TEST_FULL_TARGET} Ä {TEST_OUTPUTDIR} utils units copyfiles
  54. Echo `Date` > testprep-stamp.{TEST_FULL_TARGET}
  55. {TEST_OUTPUTDIR} Ä
  56. Set Exit 0
  57. NewFolder {TEST_OUTPUTDIR}
  58. Set Exit 1
  59. ################################
  60. # Dotest options
  61. #
  62. ################################
  63. # Run tests
  64. #
  65. # Because MPW Make lacks some features, it has to be done as below:
  66. #
  67. allexectest allexectbs allexectbf allexecwebtbs allexecwebtbf Ä testprep
  68. (Evaluate "{Targ}" =~ /allexec(Å)¨1/) > Dev:Null
  69. #Assembles, links and run tests of FreePascal
  70. Set testdir ":{¨1}"
  71. #Iterate through tests
  72. If {testdir} == :test
  73. Set subdirlist "{TESTSUBDIRS}"
  74. Else
  75. Set subdirlist :
  76. End
  77. Set Exit 0 # To handle the case, in the for stmt, when there is no match
  78. #
  79. For subdir In {subdirlist}
  80. For sourceWithExt In {testdir}{subdir}tÅ.pp #only test files, which begins with a 't'
  81. Set Exit 1 #Revert error handling
  82. #
  83. (Evaluate "{sourceWithExt}" =~ /(([Â.])*)¨1Å/) > Dev:Null
  84. Set apppath {¨1}
  85. (Evaluate "{apppath}" =~ /Å:([Â:]*)¨1/) > Dev:Null
  86. Set appname {¨1}
  87. #
  88. If NOT "`Exists :output:powerpc-macos{apppath}.elg`"
  89. # Compile and perform the test
  90. Echo Testing: "{apppath}"
  91. :utils:DoTest {DOTESTOPT} -E -X -C{TEST_FPC} "{apppath}.pp"
  92. End
  93. Set Exit 0 # To handle the case, in the for stmt, when there is no match
  94. End
  95. End
  96. Set Exit 1 #Revert error handling
  97. allexectests Ä allexectest allexectbs allexectbf allexecwebtbs allexecwebtbf
  98. ################################
  99. # Clean
  100. #
  101. clean_test Ä
  102. Set Exit 0 # To handle the case, when there is no match
  103. #
  104. Delete -y -i {TEST_OUTPUTDIR}
  105. #
  106. Delete -y -i testÅ.txt Å.tmp core
  107. #Delete -y #TODO shared library extension
  108. Delete -y -i ppas gmon.out testprep-stamp.*
  109. Delete -y -i Å_ppas
  110. #
  111. Set Exit 1 #Revert error handling
  112. clean Ä clean_test
  113. Directory :units
  114. Make clean -f MPWMake > Makeout; Makeout
  115. Directory ::
  116. distclean Ä clean
  117. Directory :utils
  118. Make clean -f MPWMake > Makeout; Makeout
  119. Directory ::
  120. cleanall Ä clean
  121. Set Exit 0 # To handle the case, when there is no match
  122. Delete -y :utils:dotest :utils:digest :utils:fail :utils:testfail
  123. Set Exit 1 #Revert error handling
  124. # Directory :utils
  125. # Make cleanall -f MPWMake > Makeout; Makeout
  126. # Directory ::
  127. ################################
  128. # Main rules
  129. #
  130. digest Ä utils
  131. :utils:digest {TEST_OUTPUTDIR}:log
  132. all Ä allexectests
  133. full Ä clean allexectests digest