Switch from -this-package-key to -this-unit-id.
[ghc.git] / testsuite / tests / rename / prog006 / Makefile
1 TOP=../../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 # Original comments relating to GHC 6.4:
6 # This test caused a panic in GHC 6.4, but in reality it is user
7 # error, caused by compiling separate modules in the program using
8 # different search paths. GHC gets confused when it can't find a
9 # module mentioned as a dependency in another interface file.
10
11 # Update for GHC 6.6:
12 # This test now succeeds, because A.hi records the fact that B.C
13 # came from the package test-1.0, so there's no conflict.
14
15 # If the package format changes, we might have to re-generate pkg.conf
16 # using the supplied Cabal configuration.
17
18 LOCAL_PKGCONF=local.package.conf
19 LOCAL_GHC_PKG = '$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF)
20
21 ifeq "$(GhcDynamicByDefault)" "YES"
22 RM_PROG006_EXTRA_FLAGS = -hisuf dyn_hi -osuf dyn_o
23 endif
24
25 rn.prog006:
26 rm -f A.hi A.o B/C.hi B/C.o Main.hi Main.o
27 rm -f A.dyn_hi A.dyn_o B/C.dyn_hi B/C.dyn_o Main.dyn_hi Main.dyn_o
28 rm -f pkg.conf
29 rm -f pwd pwd.exe pwd.exe.manifest pwd.hi pwd.o
30 '$(TEST_HC)' $(TEST_HC_OPTS) --make pwd -v0
31 '$(TEST_HC)' $(TEST_HC_OPTS) --make -this-unit-id test-1.0-XXX B.C -fforce-recomp -v0 $(RM_PROG006_EXTRA_FLAGS)
32 rm -f pkg.conf
33 echo "name: test" >>pkg.conf
34 echo "version: 1.0" >>pkg.conf
35 echo "id: test-1.0-XXX" >>pkg.conf
36 echo "key: test-1.0-XXX" >>pkg.conf
37 echo "import-dirs: `./pwd`" >>pkg.conf
38 echo "exposed-modules: B.C" >>pkg.conf
39 rm -rf $(LOCAL_PKGCONF)
40 '$(GHC_PKG)' init $(LOCAL_PKGCONF)
41 $(LOCAL_GHC_PKG) register pkg.conf -v0
42 '$(TEST_HC)' $(TEST_HC_OPTS) -c -package-db $(LOCAL_PKGCONF) -package test -fforce-recomp A.hs -i
43 # The -i clears the search path, so A.hs will find B.C from package test
44 -'$(TEST_HC)' $(TEST_HC_OPTS) -c -package-db $(LOCAL_PKGCONF) -package test -fforce-recomp Main.hs
45 # No -i when compiling Main, so a from-scratch search would find a home-pkg module B.C
46 # However, A.hi remembers that B.C came from package test, so all is ok.
47