on Windows, install to a directory with spaces (test for #1828)
[ghc-hetmet.git] / bindisttest / Makefile
1
2 .PHONY: default_target
3
4 default_target: all
5
6 # Ideally we'd just include something to give us variables
7 # for paths and arguments to tools etc, and those set in mk/build.mk.
8 TOP=..
9 include $(TOP)/mk/boilerplate.mk
10
11 ifeq "$(Windows)" "YES"
12 BIN_DIST_INST_SUBDIR = "install dir"
13 else
14 # I very much doubt that paths with spaces will work on Unix
15 BIN_DIST_INST_SUBDIR = installed
16 endif
17
18 BIN_DIST_INST_DIR = $(FPTOOLS_TOP_ABS)/bindisttest/$(BIN_DIST_INST_SUBDIR)
19
20 all:
21         $(RM) -rf $(BIN_DIST_INST_SUBDIR)
22         $(RM) -rf ghc*
23         $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
24         $(TAR) -jxf $(BIN_DIST_TARBALL)
25 ifeq "$(Windows)" "YES"
26         mv $(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
27 else
28         cd $(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
29         cd $(BIN_DIST_NAME) && make install
30 endif
31         $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
32         ./HelloWorld > output
33         $(CONTEXT_DIFF) output expected_output
34
35 clean distclean:
36         $(RM) -rf $(BIN_DIST_INST_SUBDIR)
37         $(RM) -rf ghc*
38         $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
39
40 # Ignore a load of other standard targets
41 install install-docs doc:
42         @:
43