Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. TOP = ..
  2. include $(TOP)/mk/paths.mk
  3. # Keep the `default` prerequisites in alphabetic order please!
  4. default : ac \
  5. aim4-bag \
  6. divmod \
  7. effects \
  8. hello \
  9. highlighting \
  10. html1 \
  11. html2 \
  12. library \
  13. malformed-interfaces \
  14. malonzo \
  15. minmax \
  16. other-examples \
  17. path \
  18. polydep \
  19. regexp-talk \
  20. relocatable-interfaces \
  21. simplelib \
  22. uptodate \
  23. view \
  24. agda = $(AGDA_BIN)
  25. run_agda = $(agda) -v0 --vim --ignore-interfaces --no-libraries
  26. other_files = AIM5/Hedberg/SET.agda \
  27. AIM5/yoshiki/SET.agda \
  28. Binary.agda \
  29. DoNotation.agda \
  30. DTP08/conor/Talk.agda \
  31. DTP08/ulf/Talk.agda \
  32. ISWIM.agda \
  33. Lookup.agda \
  34. Miller/Pat.agda \
  35. Monad.agda \
  36. ParenDepTac.agda \
  37. Setoid.agda \
  38. SimpleTypes.agda \
  39. syntax/Literate.lagda \
  40. Termination/Acc.agda \
  41. Termination/Mutual.agda \
  42. Termination/Nat.agda \
  43. Termination/Ord.agda \
  44. Termination/simplified-comb.agda \
  45. Termination/StreamEating.agda \
  46. Termination/StructuralOrder.agda \
  47. Termination/TerminationTwoConstructors.agda \
  48. Termination/Tuple.agda \
  49. TT.agda \
  50. Vec.agda
  51. other_examples = $(patsubst %,%.other,$(other_files))
  52. echo = $(shell which echo)
  53. ifeq ("$(echo)","")
  54. echo = echo
  55. endif
  56. .PHONY : polydep
  57. polydep : AIM5/PolyDep/Main.agda
  58. @$(echo) "Testing $<... "
  59. @$(echo) :q | $(run_agda) -iAIM5/PolyDep $<
  60. @$(echo) "ok"
  61. .PHONY : hello
  62. hello : AIM6/HelloAgda/Everything.agda
  63. @$(echo) "Testing $<... "
  64. @$(echo) :q | $(run_agda) -iAIM6/HelloAgda $<
  65. @$(echo) "ok"
  66. .PHONY : path
  67. path : AIM6/Path/All.agda
  68. @$(echo) "Testing $<... "
  69. @$(echo) :q | $(run_agda) -iAIM6/Path $<
  70. @$(echo) "ok"
  71. .PHONY : regexp-talk
  72. regexp-talk : AIM6/RegExp/talk/Everything.agda
  73. @$(echo) "Testing $<... "
  74. @$(echo) :q | $(run_agda) -iAIM6/RegExp/talk $<
  75. @$(echo) "ok"
  76. .PHONY : aim4-bag
  77. aim4-bag : AIM4/bag/Bag.agda
  78. @$(echo) "Testing $<... "
  79. @$(echo) :q | $(run_agda) -iAIM4/bag $<
  80. @$(echo) "ok"
  81. .PHONY : ac
  82. ac : tactics/ac/AC.agda
  83. @$(echo) "Testing $<... "
  84. @$(echo) :q | $(run_agda) -itactics/ac $<
  85. @$(echo) "ok"
  86. .PHONY : effects
  87. effects : sinatra/Example.agda
  88. @$(echo) "Testing $<..."
  89. @$(echo) :q | $(run_agda) -isinatra $<
  90. @$(echo) "ok"
  91. .PHONY : minmax
  92. minmax : order/MinMax.agda
  93. @$(echo) "Testing $<... "
  94. @$(echo) :q | $(run_agda) -ilib -iorder $<
  95. @$(echo) "ok"
  96. .PHONY : view
  97. view : vfl/Typechecker.agda
  98. @$(echo) "Testing $<... "
  99. @$(echo) :q | $(run_agda) -ivfl $<
  100. @$(echo) "ok"
  101. .PHONY : simplelib
  102. simplelib : simple-lib/TestLib.agda
  103. @$(echo) "Testing $<... "
  104. @$(echo) :q | $(run_agda) -isimple-lib $<
  105. @$(echo) "ok"
  106. .PHONY : library
  107. library : lib/Test.agda
  108. @$(echo) "Testing $<... "
  109. @$(echo) :q | $(run_agda) -ilib $<
  110. @$(echo) "ok"
  111. .PHONY : divmod
  112. divmod : arith/DivMod.agda
  113. @$(echo) "Testing $<... "
  114. @$(echo) :q | $(run_agda) -iarith -isimple-lib $<
  115. @$(echo) "ok"
  116. .PHONY : intro
  117. intro : Introduction/All.agda
  118. @$(echo) "Testing $<... "
  119. @$(echo) :q | $(run_agda) $<
  120. @$(echo) "ok"
  121. .PHONY : highlighting
  122. highlighting : syntax/highlighting/Test*agda
  123. @$(echo) "Testing $^... "
  124. @$(echo) :q | $(run_agda) --vim -isyntax/highlighting syntax/highlighting/Test2.agda
  125. @$(echo) :q | $(run_agda) --vim -isyntax/highlighting syntax/highlighting/Test3.lagda
  126. @$(echo) "ok"
  127. .PHONY : malonzo
  128. malonzo : compiler/main.agda
  129. @$(echo) "Testing the MAlonzo backend"
  130. @$(agda) --ignore-interfaces --compile --compile-dir=compiler -icompiler --no-libraries $<
  131. @./compiler/main
  132. # Compilation works also if the code has already been type
  133. # checked.
  134. @rm -rf compiler/main compiler/MAlonzo
  135. @$(agda) --compile --compile-dir=compiler -icompiler --no-libraries $<
  136. @./compiler/main
  137. @$(echo) "ok"
  138. .PHONY : relocatable-interfaces
  139. relocatable-interfaces : relocatable/originals/*.agda
  140. -@rm -rf relocatable/copies
  141. @$(echo) "Testing that interface files are relocatable"
  142. @$(agda) --ignore-interfaces -irelocatable/originals --no-libraries relocatable/originals/C.agda
  143. @cp -pR relocatable/originals relocatable/copies
  144. @echo "" >> relocatable/copies/B.agda
  145. # Type checking succeeds...
  146. @$(agda) -v2 -irelocatable/copies --no-libraries relocatable/copies/C.agda > relocatable/copies/output
  147. @cat relocatable/copies/output
  148. # ...and skips one of the modules (A).
  149. @[ `grep "^ *Checking A" relocatable/copies/output | wc -l` = 0 ]
  150. @[ `grep "^ *Checking B" relocatable/copies/output | wc -l` = 1 ]
  151. @[ `grep "^ *Checking C" relocatable/copies/output | wc -l` = 1 ]
  152. @rm -rf relocatable/copies
  153. .PHONY : uptodate
  154. uptodate : uptodate/*.agda
  155. @$(echo) "Testing that already imported modules are up-to-date" # despite having DOS line-endings
  156. @$(agda) -v5 --ignore-interfaces -iuptodate --no-libraries uptodate/A.agda > uptodate/output
  157. @cat uptodate/output
  158. @[ `grep "C is up-to-date" uptodate/output | wc -l` = 1 ]
  159. @rm -f uptodate/output
  160. .PHONY : malformed-interfaces
  161. malformed-interfaces : malformed/Empty.agda
  162. @$(echo) "Testing that Agda can handle at least some malformed interface files."
  163. @echo > malformed/Empty.agdai
  164. @$(agda) -imalformed --no-libraries malformed/Empty.agda
  165. -@openssl rand -out malformed/Empty.agdai 1024 2> /dev/null
  166. @$(agda) -imalformed --no-libraries malformed/Empty.agda
  167. @echo apa >> malformed/Empty.agdai
  168. @$(agda) -imalformed --no-libraries malformed/Empty.agda
  169. .PHONY : html1
  170. html1 : AIM6/RegExp/talk/Everything.agda
  171. @$(echo) "Testing HTML generation in the default directory"
  172. @$(run_agda) --html -iAIM6/RegExp/talk $<
  173. @[ -e html/Everything.html ]
  174. @rm -rf html
  175. @$(echo) "ok"
  176. .PHONY : html2
  177. html2 : AIM6/RegExp/talk/Everything.agda
  178. @$(echo) "Testing HTML generation in a particular directory"
  179. @$(run_agda) --html --html-dir=HTML -iAIM6/RegExp/talk $<
  180. @[ -e HTML/Everything.html ]
  181. @rm -rf HTML
  182. @$(echo) "ok"
  183. .PHONY : other-examples
  184. other-examples : $(other_examples)
  185. $(other_examples) : %.other : %
  186. @$(echo) -n "Testing $<... "
  187. @$(echo) :q | $(run_agda) -i$(dir $<) $<
  188. @$(echo) "ok"