Makefile 898 Bytes
Newer Older
Simon Marlow's avatar
Simon Marlow committed
1
2
3
4
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk

5
6
LOCAL_PKGCONF=local.package.conf

Simon Marlow's avatar
Simon Marlow committed
7
8
9
10
11
12
13
clean:
	rm -f p1/setup p1/Setup.o p1/Setup.hi
	rm -f p2/setup p2/Setup.o p2/Setup.hi
	rm -rf p1/dist p2/dist
	rm -f *.o *.hi
	rm -f clean.out prep.out
	rm -f p1/A.hs
14
	rm -f $(LOCAL_PKGCONF)
Simon Marlow's avatar
Simon Marlow committed
15
16

1372:
17
18
	$(MAKE) clean
	$(MAKE) prep
Simon Marlow's avatar
Simon Marlow committed
19
20
# This should recompile Main.hs, because A in package p1 has changed
# and recompiling Main.hs will now fail.
21
22
	-cd p2 && ./setup build -v0
	$(MAKE) clean
Simon Marlow's avatar
Simon Marlow committed
23
24

prep:
25
	echo "[]" >$(LOCAL_PKGCONF)
Simon Marlow's avatar
Simon Marlow committed
26
	cp p1/A1.hs p1/A.hs
27
28
	$(MAKE) prep.p1
	$(MAKE) prep.p2
Simon Marlow's avatar
Simon Marlow committed
29
	cp p1/A2.hs p1/A.hs
30
31
32
	cd p1 && ./setup build -v0

prep.%:
33
	cd $* && "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -o setup Setup.hs
34
35
36
	cd $* && ./setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF)
	cd $* && ./setup build -v0
	cd $* && ./setup register -v0 --inplace
Simon Marlow's avatar
Simon Marlow committed
37