Makefile 949 Bytes
Newer Older
Ian Lynagh's avatar
Ian Lynagh committed
1 2 3 4 5 6 7 8 9 10 11

.PHONY: default_target

default_target: all

# Ideally we'd just include something to give us variables
# for paths and arguments to tools etc, and those set in mk/build.mk.
TOP=..
include $(TOP)/mk/boilerplate.mk

all:
12
	$(RM) -rf $(BIN_DIST_INST_SUBDIR)
Ian Lynagh's avatar
Ian Lynagh committed
13 14
	$(RM) -rf ghc*
	$(RM) HelloWorld HelloWorld.o HelloWorld.hi output
15
	# --force-local makes tar not think that c:/foo refers to a remote file
16
	$(TAR) --force-local -jxf $(FPTOOLS_TOP_ABS)/$(BIN_DIST_TAR_BZ2)
17
ifeq "$(Windows)" "YES"
18
	mv $(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
19
else
20
	cd $(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
Ian Lynagh's avatar
Ian Lynagh committed
21
	cd $(BIN_DIST_NAME) && make install
22
endif
23
	$(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
Ian Lynagh's avatar
Ian Lynagh committed
24 25 26 27
	./HelloWorld > output
	$(CONTEXT_DIFF) output expected_output

clean distclean:
28
	$(RM) -rf $(BIN_DIST_INST_SUBDIR)
Ian Lynagh's avatar
Ian Lynagh committed
29 30 31 32 33 34 35
	$(RM) -rf ghc*
	$(RM) HelloWorld HelloWorld.o HelloWorld.hi output

# Ignore a load of other standard targets
install install-docs doc:
	@: