740143fcb9296f323f1d6b920998489e7b18e6d1
[ghc.git] / testsuite / tests / safeHaskell / check / pkg01 / Makefile
1 TOP=../../../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 cleanSafePkg01:
6 rm -rf setup a.out
7 rm -rf dist
8 find . -name "*.o" | xargs rm -f
9 find . -name "*.hi" | xargs rm -f
10 rm -rf local.db
11 rm -rf install
12
13 # We use the global package database as there's no easy way to tell
14 # ghc-pkg (via Cabal) to use one in ., and the global one at least
15 # won't affect the installed GHC and is more likely to work
16
17 PREFIX := $(abspath install)
18 $(eval $(call canonicalise,PREFIX))
19
20 PKGCONF = local.db
21 LGHC_PKG = '$(GHC_PKG)' --no-user-package-conf -f '$(PKGCONF)'
22
23 safePkg01:
24 '$(MAKE)' cleanSafePkg01
25 '$(TEST_HC)' --make -o setup Setup.hs -v0
26
27 '$(GHC_PKG)' init local.db
28 ./setup configure -v0 --prefix='$(PREFIX)' --with-compiler='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS) -trust base' --with-hc-pkg='$(GHC_PKG)' --package-db='$(PKGCONF)' $(PROF)
29 ./setup build -v0
30 ./setup copy -v0
31 ./setup register --inplace -v0
32 $(LGHC_PKG) list
33 $(LGHC_PKG) field safePkg01-1.0 trusted
34 echo
35 echo 'M_SafePkg'
36 '$(TEST_HC)' --show-iface dist/build/M_SafePkg.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
37 echo
38 echo 'M_SafePkg2'
39 '$(TEST_HC)' --show-iface dist/build/M_SafePkg2.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
40 echo
41 echo 'M_SafePkg3'
42 '$(TEST_HC)' --show-iface dist/build/M_SafePkg3.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
43 echo
44 echo 'M_SafePkg4'
45 '$(TEST_HC)' --show-iface dist/build/M_SafePkg4.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
46 echo
47 echo 'Testing setting trust'
48 $(LGHC_PKG) distrust safePkg01-1.0
49 $(LGHC_PKG) field safePkg01-1.0 trusted