summaryrefslogtreecommitdiff
path: root/testsuite/timeout/Makefile
blob: 9f3a4e130465046a13a336851e62ae4fe6f7dbe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
TOP = ..
include $(TOP)/mk/boilerplate.mk

HC = $(GHC_INPLACE)
MKDEPENDHS = $(GHC_INPLACE)
SRC_HC_OPTS += -threaded
EXCLUDED_SRCS += TimeMe.hs

ifeq "$(Windows)" "YES"
SRC_HC_OPTS += -package Win32
else
SRC_HC_OPTS += -package unix
endif

all :: calibrate.out

ifeq "$(findstring thr,$(GhcRTSWays))" "thr"
HS_PROG = timeout
else
all :: python-timeout
CLEAN_FILES += timeout
endif

boot :: all

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

include $(TOP)/mk/target.mk