Pass --no-user-package-conf to ghc-pkg in bindisttest
[ghc.git] / bindisttest / Makefile
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 .PHONY: default_target
14
15 default_target: all
16
17 # Ideally we'd just include something to give us variables
18 # for paths and arguments to tools etc, and those set in mk/build.mk.
19 TOP=..
20 include $(TOP)/mk/config.mk
21
22 ifeq "$(TEST_PREP)" "YES"
23 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_PREP_TAR_BZ2)
24 else
25 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_TAR_BZ2)
26 endif
27
28 all:
29 $(RM) -rf $(BIN_DIST_INST_SUBDIR)
30 $(RM) -rf a/b/c/*
31 $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
32 # We use the a/b/c subdirectory as configure looks for install-sh in
33 # . .. ../.. and we don't want it to find the build system's install-sh.
34 # --force-local makes tar not think that c:/foo refers to a remote file
35 cd a/b/c/ && $(TAR) --force-local -jxf ../../../$(BIN_DIST_TEST_TAR_BZ2)
36 ifeq "$(Windows)" "YES"
37 mv a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
38 else
39 cd a/b/c/$(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
40 cd a/b/c/$(BIN_DIST_NAME) && make install
41 endif
42 $(BIN_DIST_INST_DIR)/bin/runghc HelloWorld > output
43 $(CONTEXT_DIFF) output expected_output
44 $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
45 ./HelloWorld > output
46 $(CONTEXT_DIFF) output expected_output
47 # Without --no-user-package-conf we might pick up random packages from ~/.ghc
48 $(BIN_DIST_INST_DIR)/bin/ghc-pkg check --no-user-package-conf
49
50 clean distclean:
51 $(RM) -rf $(BIN_DIST_INST_SUBDIR)
52 $(RM) -rf a/b/c/*
53 $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
54
55 # Ignore a load of other standard targets
56 install install-docs doc:
57 @:
58