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 ifeq "$(TEST_PREP)" "YES"
14 BIN_DIST_TEST_TAR_BZ2 = $(BIN_DIST_PREP_TAR_BZ2)
16 BIN_DIST_TEST_TAR_BZ2 = $(BIN_DIST_TAR_BZ2)
21 "$(RM)" $(RM_OPTS_REC) bindisttest/$(BIN_DIST_INST_SUBDIR)
22 "$(RM)" $(RM_OPTS_REC) bindisttest/a/b/c/*
23 "$(RM)" $(RM_OPTS) bindisttest/HelloWorld
24 "$(RM)" $(RM_OPTS) bindisttest/HelloWorld.o
25 "$(RM)" $(RM_OPTS) bindisttest/HelloWorld.hi
26 "$(RM)" $(RM_OPTS) bindisttest/output
27 # We use the a/b/c subdirectory as configure looks for install-sh in
28 # . .. ../.. and we don't want it to find the build system's install-sh.
30 # NB. tar has funny interpretation of filenames sometimes (thinking
31 # c:/foo is a remote file), so it's safer to bzip and then pipe into
32 # tar rather than using tar -xjf:
33 cd bindisttest/a/b/c/ && $(BZIP2_CMD) -cd ../../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR_CMD) -xf -
34 ifeq "$(Windows)" "YES"
35 mv bindisttest/a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
37 cd bindisttest/a/b/c/$(BIN_DIST_NAME) && ./configure --prefix=$(TOP)/$(BIN_DIST_INST_DIR)
38 cd bindisttest/a/b/c/$(BIN_DIST_NAME) && $(MAKE) install
40 $(BIN_DIST_INST_DIR)/bin/runghc bindisttest/HelloWorld > bindisttest/output
41 $(CONTEXT_DIFF) bindisttest/output bindisttest/expected_output
42 $(BIN_DIST_INST_DIR)/bin/ghc --make bindisttest/HelloWorld
43 bindisttest/HelloWorld > bindisttest/output
44 $(CONTEXT_DIFF) bindisttest/output bindisttest/expected_output
45 # Without --no-user-package-conf we might pick up random packages from ~/.ghc
46 $(BIN_DIST_INST_DIR)/bin/ghc-pkg check --no-user-package-conf
48 $(eval $(call clean-target,bindisttest,all,$(BIN_DIST_INST_DIR) $(wildcard bindisttest/a/b/c/*) bindisttest/HelloWorld bindisttest/HelloWorld.o bindisttest/HelloWorld.hi bindisttest/output))