From e8a827d9892848618d5036a1de884ba0f8fe1616 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Sat, 26 Jul 1997 10:07:32 +0000
Subject: [PATCH] [project @ 1997-07-26 10:07:31 by sof]

---
 ghc/tests/mk/boilerplate.mk | 35 +++++++++++++++++++++++++++++++++++
 ghc/tests/mk/target.mk      | 28 ++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 ghc/tests/mk/boilerplate.mk
 create mode 100644 ghc/tests/mk/target.mk

diff --git a/ghc/tests/mk/boilerplate.mk b/ghc/tests/mk/boilerplate.mk
new file mode 100644
index 000000000000..8629c89a215f
--- /dev/null
+++ b/ghc/tests/mk/boilerplate.mk
@@ -0,0 +1,35 @@
+#################################################################################
+#
+#			    ghc/tests/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_TOP := $(TOP)
+TOP := $(TOP)/..
+include $(TOP)/mk/boilerplate.mk
+TOP:=$(TEST_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/mk/target.mk b/ghc/tests/mk/target.mk
new file mode 100644
index 000000000000..92d4441892fe
--- /dev/null
+++ b/ghc/tests/mk/target.mk
@@ -0,0 +1,28 @@
+#################################################################################
+#
+#			target.mk
+#
+#		ghc/tests 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
+
-- 
GitLab