[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / utils / mkdependHS / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/version.mk
4 INSTALLING=0
5
6 boot :: all
7
8 SCRIPT_PROG=mkdependHS
9 SCRIPT_OBJS=mkdependHS.prl
10 SCRIPT_SUBST_VARS= \
11  TOP_PWD \
12  INSTALLING
13
14 INTERP=perl
15
16 #
17 # install setup
18 #
19 INSTALL_SCRIPTS += $(SCRIPT_PROG)
20
21 ifneq "$(BIN_DIST)" "1"
22 SCRIPT_SUBST_VARS += libdir datadir RAWCPP TMPDIR SED
23 endif
24
25
26 #
27 # Prepend an infomercial if installing (binary-dist or the real thing).
28 #
29 ifeq "$(INSTALLING)" "1"
30 ifeq "$(BIN_DIST)" "1"
31 SCRIPT_PREFIX_FILES += prefix.txt
32 endif
33 endif
34
35 ifeq "$(INSTALLING)" "1"
36 TOP_PWD:=$(prefix)
37 else
38 TOP_PWD:=$(FPTOOLS_TOP_ABS)
39 endif
40
41 #
42 # Before really installing the script, we have to
43 # reconfigure it such that the paths it refers to,
44 # point to the installed utils.
45 #
46 install ::
47         $(RM) $(SCRIPT_PROG)
48         $(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
49
50 CLEAN_FILES += $(SCRIPT_PROG) $(SCRIPT_LINK)
51
52 include $(TOP)/mk/target.mk
53
54 #
55 # Hack to re-create the in-situ build tree script after 
56 # having just installed it (if you don't, confusion ensues
57 # if you try to use the build tree copy afterwards..)
58 #
59 install ::
60         @$(RM) $(SCRIPT_PROG)
61         @$(MAKE) $(MFLAGS) $(SCRIPT_PROG)