Simon's hacking on monad-comp; incomplete
[ghc-hetmet.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/tree.mk
21 include $(TOP)/mk/config.mk
22
23 ifeq "$(TEST_PREP)" "YES"
24 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_PREP_TAR_BZ2)
25 else
26 BIN_DIST_TEST_TAR_BZ2 = ../$(BIN_DIST_TAR_BZ2)
27 endif
28
29 all:
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.
35 #
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)
42 else
43         cd a/b/c/$(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
44         cd a/b/c/$(BIN_DIST_NAME) && $(MAKE) install
45 endif
46         $(BIN_DIST_INST_DIR)/bin/runghc HelloWorld > output
47         $(CONTEXT_DIFF) output expected_output
48         $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
49         ./HelloWorld > output
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
53
54 clean distclean:
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
58
59 # Ignore a load of other standard targets
60 install install-docs doc:
61         @:
62
63 show:
64         @echo '$(VALUE)="$($(VALUE))"'
65