1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.25 1999/10/27 09:43:25 simonmar Exp $
4 # We create two driver scripts:
5 # - one to run in-place in the build tree for building libraries
6 # - one wired to the install locations for later installation
8 # the installation script is built first, and we invoke make recursively
9 # to build the in-place version.
12 CURRENT_DIR=ghc/driver
13 include $(TOP)/mk/boilerplate.mk
23 INSTALLED_SCRIPT_PROG = ghc-$(ProjectVersion)
24 INPLACE_SCRIPT_PROG = ghc-inplace
26 ifeq "$(INSTALLING)" "1"
28 SCRIPT_PROG = $(INSTALLED_SCRIPT_PROG)
31 TOP_PWD := $(FPTOOLS_TOP_ABS)
32 SCRIPT_PROG = $(INPLACE_SCRIPT_PROG)
39 SCRIPT_SUBST_VARS := \
41 ProjectName ProjectVersion ProjectVersionInt \
42 HscMajorVersion HscMinorVersion CcMajorVersion CcMinorVersion \
43 CURRENT_DIR HOSTPLATFORM TARGETPLATFORM \
44 GHC_LIB_DIR GHC_RUNTIME_DIR GHC_INCLUDE_DIR \
45 GHC_OPT_HILEV_ASM GhcWithNativeCodeGen LeadingUnderscore\
46 GHC_UNLIT GHC_HSCPP GHC_MKDEPENDHS GHC_HSC GHC_SYSMAN EnableWin32DLLs \
47 CP RM CONTEXT_DIFF LibGmp GhcWithRegisterised
50 # When creating a binary distribution, we prefix the driver script
51 # with a short msg about what variables need to be set to get the
55 ifeq "$(BIN_DIST)" "1"
56 SCRIPT_PREFIX_FILES=prefix.txt
58 SCRIPT_SUBST_VARS += libdir libexecdir datadir bindir TMPDIR TOP_PWD
61 all :: $(DYN_LOADABLE_BITS)
63 # don't recurse on 'make install'
65 ifeq "$(INSTALLING)" "1"
66 all clean veryclean maintainer-clean ::
67 $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
72 # the driver goes in $(bindir), the perl script helpers
75 # ToDo: allow different install name for driver?
77 INSTALL_SCRIPTS += $(SCRIPT_PROG)
78 INSTALL_LIBS += $(DYN_LOADABLE_BITS)
81 # depend setup: other directories need the driver script to compute
82 # their dependencies, so `depend' is simply an alias for `all' here.
88 CLEAN_FILES += $(SCRIPT_OBJS) $(SCRIPT_LINK) $(DYN_LOADABLE_BITS) ghc-[0-9].*
93 SRC_DEST_FILES=$(patsubst %.prl,%.lprl,$(DYN_LOADABLE_BITS)) ghc.lprl ordering-passes test_mangler
95 include $(TOP)/mk/target.mk
97 ghc.prl : $(TOP)/mk/version.mk
100 # Another hack (hmm..I can see a pattern developing here :-)
101 # In ghc/driver, we create a symlink from ghc-<whatever-version> to
102 # ghc, but we don't want this included in a source distribution.
103 # We `solve' this by removing `ghc' from the dist tree here.
105 @echo "Patching dist tree: removing $(SRC_DIST_DIR)/ghc symlink"
106 $(RM) $(SRC_DIST_DIR)/ghc