Add a test for TH's qAddDependentFile
[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) -v0 -c T2386_Lib.hs -fforce-recomp
9 '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T2386.hs -fforce-recomp
10
11
12 HC_OPTS = -XTemplateHaskell -package template-haskell
13
14 TH_spliceE5_prof::
15 $(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.p.o
16 '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -c
17 '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf p.o -o $@
18 ./$@
19
20 .PHONY: TH_Depends
21 TH_Depends:
22 $(RM) TH_Depends_external.txt
23 $(RM) TH_Depends TH_Depends.exe
24 $(RM) TH_Depends.o TH_Depends.hi
25 $(RM) TH_Depends_External.o TH_Depends_External.hi
26 echo "first run" > TH_Depends_external.txt
27 '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 TH_Depends
28 ./TH_Depends
29 # Remove the executable, as GHC won't relink if the timestamps seem to
30 # be the same
31 $(RM) TH_Depends TH_Depends.exe
32 echo "second run" > TH_Depends_external.txt
33 # Give TH_Depends_external.txt a future date in case it gets the same
34 # timestamp again
35 touch --date="now + 3 seconds" TH_Depends_external.txt
36 '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 TH_Depends
37 ./TH_Depends
38