summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/recomp004/Makefile
blob: 4ad51d8f60208ac5c7337b63223385926ab6a0ef (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
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk

EXECUTABLE = MainX$(exeext)
CLEAN_FILES = c.c c.o MainX.o MainX.hi $(EXECUTABLE)

clean:
	$(RM) $(CLEAN_FILES)

# Test that updates to C modules are noticed
recomp004:
	$(RM) $(CLEAN_FILES)
	$(CP) c1.c c.c
	$(CP) Main.hs MainX.hs
	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c c.c -o c.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make MainX.hs c.o -o $(EXECUTABLE)
	./$(EXECUTABLE)
	$(CP) c2.c c.c
	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c c.c -o c.o
	# Hack to make sure c.o is really newer
	touch -t 01010000 MainX.hs MainX.hi MainX.o c.c $(EXECUTABLE)
	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make MainX.hs c.o -o $(EXECUTABLE)
	./$(EXECUTABLE)