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