summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/recomp004/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/driver/recomp004/Makefile')
-rw-r--r--testsuite/tests/driver/recomp004/Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/driver/recomp004/Makefile b/testsuite/tests/driver/recomp004/Makefile
new file mode 100644
index 0000000000..41b93b169d
--- /dev/null
+++ b/testsuite/tests/driver/recomp004/Makefile
@@ -0,0 +1,24 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+EXECUTABLE = Main$(exeext)
+CLEAN_FILES = c.c c.o Main.o Main.hi $(EXECUTABLE)
+
+clean:
+ $(RM) $(CLEAN_FILES)
+
+# Test that updates to C modules are noticed
+recomp004:
+ $(RM) $(CLEAN_FILES)
+ $(CP) c1.c c.c
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c c.c -o c.o
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Main.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 Main.hs Main.hi Main.o c.c $(EXECUTABLE)
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Main.hs c.o -o $(EXECUTABLE)
+ ./$(EXECUTABLE)
+