1 # -----------------------------------------------------------------------------
3 # (c) 2009 The University of Glasgow
5 # This file is part of the GHC build system.
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
11 # -----------------------------------------------------------------------------
13 .PHONY: default_target
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.
20 include $(TOP)/mk/config.mk
22 ifeq "$(TEST_PREP)" "YES"
23 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_PREP_TAR_BZ2)
25 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_TAR_BZ2)
29 $(RM) -rf $(BIN_DIST_INST_SUBDIR)
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.
35 # NB. tar has funny interpretation of filenames sometimes (thinking
36 # c:/foo is a remote file), so it's safer to bzip and then pipe into
37 # tar rather than using tar -xjf:
38 cd a/b/c/ && bzip2 -cd ../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR) -xf -
39 ifeq "$(Windows)" "YES"
40 mv a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
42 cd a/b/c/$(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
43 cd a/b/c/$(BIN_DIST_NAME) && make install
45 $(BIN_DIST_INST_DIR)/bin/runghc HelloWorld > output
46 $(CONTEXT_DIFF) output expected_output
47 $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
49 $(CONTEXT_DIFF) output expected_output
50 # Without --no-user-package-conf we might pick up random packages from ~/.ghc
51 $(BIN_DIST_INST_DIR)/bin/ghc-pkg check --no-user-package-conf
54 $(RM) -rf $(BIN_DIST_INST_SUBDIR)
56 $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
58 # Ignore a load of other standard targets
59 install install-docs doc: