[project @ 1997-09-05 14:26:29 by simonm]
authorsimonm <unknown>
Fri, 5 Sep 1997 14:26:29 +0000 (14:26 +0000)
committersimonm <unknown>
Fri, 5 Sep 1997 14:26:29 +0000 (14:26 +0000)
separate mk directory for programs

ghc/tests/programs/mk/boilerplate.mk [new file with mode: 0644]
ghc/tests/programs/mk/target.mk [new file with mode: 0644]

diff --git a/ghc/tests/programs/mk/boilerplate.mk b/ghc/tests/programs/mk/boilerplate.mk
new file mode 100644 (file)
index 0000000..f4ded2a
--- /dev/null
@@ -0,0 +1,35 @@
+#################################################################################
+#
+#                          ghc/tests/programs/mk/boilerplate.mk
+#
+#              Boilerplate Makefile for an fptools project
+#
+#################################################################################
+
+# Begin by slurping in the boilerplate from one level up, 
+# with standard TOP-mangling
+# Remember, TOP is the top level of the innermost level
+# ( FPTOOLS_TOP, which will be set while processing
+#   toplevel boilerplate, is the fptools top )
+
+TEST_PROGRAMS_TOP := $(TOP)
+TOP := $(TOP)/..
+include $(TOP)/mk/boilerplate.mk
+TOP:=$(TEST_PROGRAMS_TOP)
+
+
+# -----------------------------------------------------------------
+# Everything after this point
+# augments or overrides previously set variables.
+# (these files are optional, so `make' won't fret if it
+#  cannot get to them).
+# -----------------------------------------------------------------
+
+
+# Define TEST_PROG.  In ..../nofib/imaginary/exp3_8, PROG is exp3_8 by default.
+#
+TEST_PROG = $(notdir $(shell pwd))$(_way)
+
+# Eventually, have the binary purged
+CLEAN_FILES += $(TEST_PROG)
+
diff --git a/ghc/tests/programs/mk/target.mk b/ghc/tests/programs/mk/target.mk
new file mode 100644 (file)
index 0000000..da6ab86
--- /dev/null
@@ -0,0 +1,26 @@
+#################################################################################
+#
+#                      target.mk
+#
+#              ghc/tests/programs standard target rules
+#
+#################################################################################
+
+# Link step
+$(TEST_PROG) : $(OBJS)
+       $(HC) $(HC_FLAGS) $(OBJS) -o $(TEST_PROG)
+
+# Run test
+runtest : $(TEST_PROG)
+       $(RUNTEST) ./$< \
+         $(addprefix -i ,$(wildcard $(TEST_PROG).stdin)) \
+         $(addprefix -o1 ,$(wildcard $(TEST_PROG).stdout)) \
+         $(addprefix -o2 ,$(wildcard $(TEST_PROG).stderr)) \
+         $(RUNTEST_OPTS)
+
+# Include standard boilerplate
+# We do this at the end for cosmetic reasons: it means that the "normal-way"
+# runtests will precede the "other-way" recursive invocations of make
+
+include $(FPTOOLS_TOP)/mk/target.mk
+