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