summaryrefslogtreecommitdiff
path: root/testsuite/timeout
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-07-23 20:24:43 +0000
committerIan Lynagh <igloo@earth.li>2008-07-23 20:24:43 +0000
commitaec015c6deefba69b4d181be9ba67f1930577bea (patch)
tree234b4d5758b4161856230b7984b394366e728c6c /testsuite/timeout
parent89792c20e13e009f42a6bf5f52dc0348ff10f928 (diff)
downloadhaskell-aec015c6deefba69b4d181be9ba67f1930577bea.tar.gz
Build the timeout program with Cabal
Diffstat (limited to 'testsuite/timeout')
-rw-r--r--testsuite/timeout/Makefile59
-rw-r--r--testsuite/timeout/timeout.cabal24
2 files changed, 51 insertions, 32 deletions
diff --git a/testsuite/timeout/Makefile b/testsuite/timeout/Makefile
index 64c2ec7ae4..7accd59426 100644
--- a/testsuite/timeout/Makefile
+++ b/testsuite/timeout/Makefile
@@ -1,41 +1,36 @@
-TOP = ..
+TOP = ../..
include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/cabal-flags.mk
-HC = $(GHC_INPLACE)
-# These are required to stop the build system adding -package-conf
-# bootstrapping.mk, which only makes sense when $(HC)==$(GHC)
-BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS=
-BOOTSTRAPPING_PACKAGE_CONF_MKDEPENDHS_OPTS=
+TIMEOUT_PROGRAM = install-inplace/bin/timeout$(exeext)
-MKDEPENDHS = $(GHC_INPLACE)
-SRC_HC_OPTS += -threaded
-EXCLUDED_SRCS += TimeMe.hs
-
-ifeq "$(Windows)" "YES"
-SRC_HC_OPTS += -package Win32
+ifeq "$(findstring thr,$(GhcRTSWays))" ""
+$(TIMEOUT_PROGRAM): timeout.py
+ $(MKDIRHIER) `dirname $@`
+ cp $< $@
+ chmod +x $@
else
-SRC_HC_OPTS += -package unix
+$(TIMEOUT_PROGRAM): timeout.hs
+ $(CABAL) configure $(USE_STAGE1_CONFIGURE_FLAGS) \
+ $(INPLACE_DIRS_CONFIGURE_FLAGS) \
+ $(COMMON_CONFIGURE_FLAGS) \
+ --ghc-option=-threaded
+ $(CABAL) build
+ $(CABAL) install
endif
-all :: calibrate.out
-
-ifeq "$(findstring thr,$(GhcRTSWays))" "thr"
-HS_PROG = timeout
-else
-all :: python-timeout
-CLEAN_FILES += timeout
-endif
-
-boot :: all
+boot all :: calibrate.out $(TIMEOUT_PROGRAM)
calibrate.out:
- rm -f TimeMe.o TimeMe.hi TimeMe
- $(PYTHON) calibrate "$(HC)" > $@
-
-CLEAN_FILES += calibrate.out
-
-python-timeout:
- cp timeout.py timeout
- chmod +x timeout
+ $(RM) -f TimeMe.o TimeMe.hi TimeMe TimeMe.exe
+ $(PYTHON) calibrate "$(GHC_STAGE1)" > $@
+# We use stage 1 to do the calibration, as stage 2 may not exist.
+# This isn't necessarily the compiler we'll be running the testsuite
+# with, but it's really the performance of the machine that we're
+# interested in
+
+clean distclean:
+ $(CABAL) clean
+ $(RM) -rf install-inplace
+ $(RM) -f calibrate.out
-include $(TOP)/mk/target.mk
diff --git a/testsuite/timeout/timeout.cabal b/testsuite/timeout/timeout.cabal
new file mode 100644
index 0000000000..276edb4791
--- /dev/null
+++ b/testsuite/timeout/timeout.cabal
@@ -0,0 +1,24 @@
+Name: timeout
+-- XXX Version number:
+Version: 1
+Copyright: XXX
+License: BSD3
+-- XXX License-File: LICENSE
+Author: XXX
+Maintainer: XXX
+Synopsis: XXX
+Description:
+ XXX
+Category: Development
+build-type: Simple
+cabal-version: >=1.2
+
+Executable timeout
+ Main-Is: timeout.hs
+ Extensions: CPP
+ Build-Depends: base, process
+ if os(windows)
+ Build-Depends: Win32
+ else
+ Build-Depends: unix
+