summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/recomp011/Makefile
blob: 71eb55e755d6d00894eed1d5eda41b7e9f55f215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk

# -fforce-recomp makes lots of driver tests trivially pass, so we
# filter it out from $(TEST_HC_OPTS).
TEST_HC_OPTS_NO_RECOMP = $(filter-out -fforce-recomp,$(TEST_HC_OPTS))

# Recompilation tests

clean:
	rm -f *.o *.hi
	rm -f A.hsinc B.hsinc
	rm -f Main$(exeext)

recomp011: clean
	echo "main = putStrLn x" >A.hsinc
	echo "x = show 42" >B.hsinc
	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make -O Main.hs
	./Main
	sleep 1
	echo "x = show 43" >B.hsinc
	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make -O Main.hs
	./Main
	sleep 1
	echo "main = putStrLn (x ++ x)" >A.hsinc
	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make -O Main.hs
	sleep 1
	./Main
	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make -O Main.hs
	# don't change anything; check that no compilation happened
	./Main