Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
aec015c6
Commit
aec015c6
authored
Jul 23, 2008
by
Ian Lynagh
Browse files
Build the timeout program with Cabal
parent
89792c20
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/mk/test.mk
View file @
aec015c6
...
...
@@ -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
=
\"
$(T
OP)
/timeout/timeout
\"
\
-e
config.timeout_prog
=
\"
$(T
IMEOUT_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
...
...
testsuite/timeout/Makefile
View file @
aec015c6
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
testsuite/timeout/timeout.cabal
0 → 100644
View file @
aec015c6
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment