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/tree.mk
21 include $(TOP)/mk/config.mk
23 ifeq "$(TEST_PREP)" "YES"
24 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_PREP_TAR_BZ2)
26 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_TAR_BZ2)
30 "$(RM)" $(RM_OPTS_REC) $(BIN_DIST_INST_SUBDIR)
31 "$(RM)" $(RM_OPTS_REC) a/b/c/*
32 "$(RM)" $(RM_OPTS) HelloWorld HelloWorld.o HelloWorld.hi output
33 # We use the a/b/c subdirectory as configure looks for install-sh in
34 # . .. ../.. and we don't want it to find the build system's install-sh.
36 # NB. tar has funny interpretation of filenames sometimes (thinking
37 # c:/foo is a remote file), so it's safer to bzip and then pipe into
38 # tar rather than using tar -xjf:
39 cd a/b/c/ && $(BZIP2_CMD) -cd ../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR_CMD) -xf -
40 ifeq "$(Windows)" "YES"
41 mv a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
43 cd a/b/c/$(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
44 cd a/b/c/$(BIN_DIST_NAME) && $(MAKE) install
46 $(BIN_DIST_INST_DIR)/bin/runghc HelloWorld > output
47 $(CONTEXT_DIFF) output expected_output
48 $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
50 $(CONTEXT_DIFF) output expected_output
51 # Without --no-user-package-conf we might pick up random packages from ~/.ghc
52 $(BIN_DIST_INST_DIR)/bin/ghc-pkg check --no-user-package-conf
55 "$(RM)" $(RM_OPTS_REC) $(BIN_DIST_INST_SUBDIR)
56 "$(RM)" $(RM_OPTS_REC) a/b/c/*
57 "$(RM)" $(RM_OPTS) HelloWorld HelloWorld.o HelloWorld.hi output
59 # Ignore a load of other standard targets
60 install install-docs doc:
64 @echo '$(VALUE)="$($(VALUE))"'