Add 'hadrian/' from commit '45f3bff7016a2a0cd9a5455a882ced984655e90b'
[ghc.git] / testsuite / tests / th / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 # Trac 2386 requires batch-compile not --make
6 # Very important: without -O
7 T2386:
8 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) -v0 -c T2386_Lib.hs
9 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) -v0 -c T2386.hs
10
11 T7445:
12 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) -v0 -c T7445a.hs
13 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) -v0 -c T7445.hs
14
15 HC_OPTS = -XTemplateHaskell -package template-haskell
16
17 TH_spliceE5_prof::
18 $(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.dyn_o TH_spliceE5_prof*.dyn_hi TH_spliceE5_prof
19 '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -no-link -v0 TH_spliceE5_prof.hs
20 # Using `-osuf .p.o` should work. Note the dot before the `p` (#9760), and
21 # the dot between the `p` and the `o` (#5554).
22 '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -fprof-auto -osuf .p.o -o $@
23 ./$@
24
25 # With -fexternal-interpreter, we don't have to build the non-profiled
26 # objects first.
27 TH_spliceE5_prof_ext::
28 $(RM) TH_spliceE5_prof_ext*.o TH_spliceE5_prof_ext*.hi TH_spliceE5_prof_ext*.p.o
29 '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof_ext.hs -prof -fprof-auto -fexternal-interpreter -o $@
30 ./$@
31
32 .PHONY: TH_Depends
33 TH_Depends:
34 $(RM) TH_Depends_external.txt
35 $(RM) TH_Depends TH_Depends.exe
36 $(RM) TH_Depends.o TH_Depends.hi
37 $(RM) TH_Depends_External.o TH_Depends_External.hi
38 echo "first run" > TH_Depends_external.txt
39 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) --make -v0 TH_Depends
40 ./TH_Depends
41 sleep 2
42 echo "second run" > TH_Depends_external.txt
43 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) --make -v0 TH_Depends
44 ./TH_Depends
45
46
47 T8333:
48 '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghcThWayFlags) T8333.hs < /dev/null
49
50 # This was an easy way to re-use the stdout testing
51 # to check the contents of a generated file.
52 T8624:
53 '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) -v0 -c T8624.hs && cat T8624.th.hs
54 $(RM) T8624.th.hs