Clean the right directory in bindisttest
[ghc.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/config.mk
21
22 all:
23 $(RM) -rf $(BIN_DIST_INST_SUBDIR)
24 $(RM) -rf a/b/c/*
25 $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
26 # We use the a/b/c subdirectory as configure looks for install-sh in
27 # . .. ../.. and we don't want it to find the build system's install-sh.
28 # --force-local makes tar not think that c:/foo refers to a remote file
29 cd a/b/c/ && $(TAR) --force-local -jxf $(BIN_DIST_TAR_BZ2)
30 ifeq "$(Windows)" "YES"
31 mv a/b/c/$(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
32 else
33 cd a/b/c/$(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
34 cd a/b/c/$(BIN_DIST_NAME) && make install
35 endif
36 $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
37 ./HelloWorld > output
38 $(CONTEXT_DIFF) output expected_output
39 $(BIN_DIST_INST_DIR)/bin/ghc-pkg check
40
41 clean distclean:
42 $(RM) -rf $(BIN_DIST_INST_SUBDIR)
43 $(RM) -rf a/b/c/*
44 $(RM) HelloWorld HelloWorld.o HelloWorld.hi output
45
46 # Ignore a load of other standard targets
47 install install-docs doc:
48 @:
49