The Backpack patch.
[ghc.git] / testsuite / tests / backpack / cabal / bkpcabal01 / Makefile
1 TOP=../../../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 SETUP=./Setup -v0
6 CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=tmp.d --prefix='$(PWD)/inst'
7
8 bkpcabal01: clean
9 $(MAKE) -s --no-print-directory clean
10 '$(GHC_PKG)' init tmp.d
11 '$(TEST_HC)' -v0 --make Setup
12 cp p/P.hs.in1 p/P.hs
13 cp q/Q.hs.in1 q/Q.hs
14 # typecheck p
15 $(CONFIGURE) --cid "p-0.1" p
16 $(SETUP) build
17 $(SETUP) copy
18 $(SETUP) register
19 # build impl
20 $(CONFIGURE) --cid "impl-0.1" impl
21 $(SETUP) build
22 $(SETUP) copy
23 $(SETUP) register
24 # typecheck q
25 $(CONFIGURE) --cid "q-0.1" q
26 $(SETUP) build
27 $(SETUP) copy
28 $(SETUP) register
29 # build p
30 $(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H"
31 $(SETUP) build
32 $(SETUP) copy
33 $(SETUP) register
34 # build q
35 $(CONFIGURE) --cid "q-0.1" q --instantiate-with "I=impl-0.1:I"
36 $(SETUP) build
37 $(SETUP) copy
38 $(SETUP) register
39 # OK, now the crux of the test: recompilation.
40 cp p/P.hs.in2 p/P.hs
41 cp q/Q.hs.in2 q/Q.hs
42 # re-typecheck p
43 $(CONFIGURE) --cid "p-0.1" p
44 $(SETUP) build
45 $(SETUP) copy
46 $(SETUP) register
47 # re-typecheck q (if buggy, this is what would fail)
48 $(CONFIGURE) --cid "q-0.1" q
49 $(SETUP) build
50 $(SETUP) copy
51 $(SETUP) register
52 # re-build p
53 $(CONFIGURE) --cid "p-0.1" p --instantiate-with "H=impl-0.1:H"
54 $(SETUP) build
55 $(SETUP) copy
56 $(SETUP) register
57 # re-build q
58 $(CONFIGURE) --cid "q-0.1" q --instantiate-with "I=impl-0.1:I"
59 $(SETUP) build
60 $(SETUP) copy
61 $(SETUP) register
62 # build exe
63 $(CONFIGURE) --cid "exe-0.1" exe
64 $(SETUP) build
65 dist/build/exe/exe
66 ifneq "$(CLEANUP)" ""
67 $(MAKE) -s --no-print-directory clean
68 endif
69
70 clean :
71 $(RM) -r tmp.d inst dist Setup$(exeext)