Make -w less aggressive (Trac #12056)
[ghc.git] / testsuite / tests / safeHaskell / check / pkg01 / Makefile
1 TOP=../../../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 cleanPackageDatabase.%:
6 rm -rf pdb.$*
7
8 HERE := $(abspath .)
9 $(eval $(call canonicalise,HERE))
10
11 ifeq "$(GhcDynamicByDefault)" "YES"
12 HI_SUF = dyn_hi
13 else
14 HI_SUF = hi
15 endif
16
17 mkPackageDatabase.%:
18 $(MAKE) -s --no-print-directory cleanPackageDatabase.$*
19 mkdir pdb.$*
20
21 '$(TEST_HC)' -outputdir pdb.$* -o pdb.$*/setup Setup.hs -v0
22
23 '$(GHC_PKG)' init pdb.$*/local.db
24 # We don't make use of -rtsopts in this test, and if it's enabled then
25 # we get a warning if dynlibs are enabled by default that:
26 # Warning: -rtsopts and -with-rtsopts have no effect with -shared.
27 # so we filter the flag out
28 pdb.$*/setup configure -v0 --dist pdb.$*/dist --prefix='$(HERE)/pdb.$*/install' --with-compiler='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS)) -trust base -trust bytestring' --with-hc-pkg='$(GHC_PKG)' --package-db='pdb.$*/local.db' $(VANILLA) $(PROF) $(DYN)
29 pdb.$*/setup build -v0 --dist pdb.$*/dist
30 pdb.$*/setup copy -v0 --dist pdb.$*/dist
31 pdb.$*/setup register -v0 --dist pdb.$*/dist --inplace
32
33 # We use the global package database as there's no easy way to tell
34 # ghc-pkg (via Cabal) to use one in ., and the global one at least
35 # won't affect the installed GHC and is more likely to work
36
37 safePkg01_GHC_PKG = '$(GHC_PKG)' --no-user-package-db -f pdb.safePkg01/local.db
38
39 SHOW_IFACE=-dppr-cols999 --show-iface
40 safePkg01:
41 $(MAKE) -s --no-print-directory mkPackageDatabase.safePkg01
42
43 $(safePkg01_GHC_PKG) list
44 $(safePkg01_GHC_PKG) field safePkg01-1.0 trusted
45 echo
46 echo 'M_SafePkg'
47 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
48 echo
49 echo 'M_SafePkg2'
50 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg2.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
51 echo
52 echo 'M_SafePkg3'
53 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg3.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
54 echo
55 echo 'M_SafePkg4'
56 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg4.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
57 echo
58 echo 'M_SafePkg5'
59 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg5.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
60 echo
61 echo 'M_SafePkg6'
62 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg6.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
63 echo
64 echo 'M_SafePkg7'
65 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg7.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
66 echo
67 echo 'M_SafePkg8'
68 '$(TEST_HC)' $(SHOW_IFACE) pdb.safePkg01/dist/build/M_SafePkg8.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
69 echo
70 echo 'Testing setting trust'
71 $(safePkg01_GHC_PKG) trust safePkg01-1.0
72 $(safePkg01_GHC_PKG) field safePkg01-1.0 trusted
73 $(safePkg01_GHC_PKG) distrust safePkg01-1.0
74 $(safePkg01_GHC_PKG) field safePkg01-1.0 trusted
75 $(safePkg01_GHC_PKG) distrust safePkg01-1.0
76 $(safePkg01_GHC_PKG) field safePkg01-1.0 trusted
77