Makefile 1.55 KB
Newer Older
1
TOP = ..
2
3
4
5
6
7
8
9
10

# If we're cleaning then we don't want to do all the GHC detection hardwork,
# and we certainly don't want to fail if GHC etc can't be found!
# However, we can't just put this conditional in boilerplate.mk, as
# some of the tests have a "clean" makefile target that relies on GHC_PKG
# being defined.
ifneq "$(MAKECMDGOALS)" "clean"
ifneq "$(MAKECMDGOALS)" "distclean"

11
12
include $(TOP)/mk/boilerplate.mk

13
TIMEOUT_PROGRAM = install-inplace/bin/timeout$(exeext)
Simon Marlow's avatar
Simon Marlow committed
14

15
16
17
PREFIX := $(abspath install-inplace)
$(eval $(call canonicalise,PREFIX))

18
19
20
21
ifneq "$(GCC)" ""
WITH_GCC = --with-gcc=$(GCC)
endif

22
ifeq "$(filter thr, $(GhcRTSWays))" ""
23
$(TIMEOUT_PROGRAM): timeout.py
24
25
26
	rm -rf install-inplace
	mkdir install-inplace
	mkdir install-inplace/bin
27
28
	cp $< $@
	chmod +x $@
29
else
30
$(TIMEOUT_PROGRAM): timeout.hs
31
32
	rm -rf install-inplace
	$(TEST_HC) --make Setup
33
34
35
	./Setup configure --with-compiler=$(TEST_HC) \
	                  --with-hc-pkg=$(GHC_PKG) \
	                  $(WITH_GCC) \
36
	                  --ghc-option=-threaded --prefix=$(PREFIX)
37
38
	./Setup build
	./Setup install
39
40
endif

41
boot all :: calibrate.out $(TIMEOUT_PROGRAM)
Simon Marlow's avatar
Simon Marlow committed
42

43
calibrate.out:
44
45
46
47
48
49
50
	$(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

51
52
53
endif
endif

54
clean distclean:
Ian Lynagh's avatar
Ian Lynagh committed
55
	-./Setup clean
56
57
	$(RM) -rf install-inplace
	$(RM) -f calibrate.out
Ian Lynagh's avatar
Ian Lynagh committed
58
	$(RM) -f Setup Setup.exe Setup.hi Setup.o
59