Commit aec015c6 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Build the timeout program with Cabal

parent 89792c20
......@@ -104,7 +104,7 @@ RUNTEST_OPTS += \
-e config.wordsize=\"$(WORDSIZE)\" \
-e default_testopts.cleanup=\"$(CLEANUP)\" \
-e config.timeout="int($(TIMEOUT)) or config.timeout" \
-e config.timeout_prog=\"$(TOP)/timeout/timeout\" \
-e config.timeout_prog=\"$(TIMEOUT_PROGRAM)\" \
-e config.exeext=\"$(exeext)\" \
-e config.top=\"$(FPTOOLS_TOP_ABS)/testsuite\" \
$(EXTRA_RUNTEST_OPTS)
......@@ -130,9 +130,11 @@ WAY =
all :: test
timeout : $(TOP)/timeout/timeout$(exeext)
TIMEOUT_PROGRAM = $(TOP)/timeout/install-inplace/bin/timeout$(exeext)
$(TOP)/timeout/timeout$(exeext) :
timeout : $(TIMEOUT_PROGRAM)
$(TIMEOUT_PROGRAM) :
@echo "Looks like you don't have timeout, building it first..."
cd $(TOP)/timeout && $(MAKE) $(MFLAGS) all
......
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
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment