Makefile 1.73 KB
Newer Older
1
TOP=../../..
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk

# SETUP=../Setup
SETUP=../Setup -v0

# This test is for overlapping/shadowing packages with Cabal.  We
#   1. install p-1.0 to the global DB
#   2. install q-1.0 (depending on p-1.0) to a temporary DB
#   3. install a differnet p-1.0 to the temp DB
#   4. attempt to configure and buidl r, which depends on p-1.0 and q-1.0
#
# step 4 will elicit a warning from Cabal's configure step that the
# packages are inconsistent, and will cause an error from GHC.
# Currently the error message from GHC is swallowed by Cabal.

cabal03: clean
Simon Marlow's avatar
Simon Marlow committed
19
	$(MAKE) clean
Ian Lynagh's avatar
Ian Lynagh committed
20 21
	'$(GHC_PKG)' init tmp.d
	'$(TEST_HC)' -v0 --make Setup
Ian Lynagh's avatar
Ian Lynagh committed
22
	cd p && $(SETUP) clean
23
	cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force
Ian Lynagh's avatar
Ian Lynagh committed
24
	cd p && $(SETUP) build
25
	cd p && $(SETUP) register
26
	cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
Ian Lynagh's avatar
Ian Lynagh committed
27
	cd q && $(SETUP) build
28
	cd q && $(SETUP) register
Ian Lynagh's avatar
Ian Lynagh committed
29
	cd p && $(SETUP) clean
30
	cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
Ian Lynagh's avatar
Ian Lynagh committed
31
	cd p && $(SETUP) build
32
	cd p && $(SETUP) register
33
	cd r && ! ../Setup configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
34 35 36 37 38
ifneq "$(CLEANUP)" ""
	$(MAKE) clean
endif

clean :
Ian Lynagh's avatar
Ian Lynagh committed
39 40
	'$(GHC_PKG)' unregister --force p >/dev/null 2>&1 || true
	'$(GHC_PKG)' unregister --force q >/dev/null 2>&1 || true
Simon Marlow's avatar
Simon Marlow committed
41
	$(RM) -r tmp.d *.o *.hi */*.o */*.hi */Setup$(exeext) */dist Setup$(exeext)