Massive patch for the first months work adding System FC to GHC #15
[ghc-hetmet.git] / utils / hstags / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/version.mk
4
5 # Note: might be overridden from cmd-line (see install rule below)
6 INSTALLING=0
7
8 C_PROG=hstags-help
9 SRC_CC_OPTS += -O
10
11 SCRIPT_PROG=hstags
12 SCRIPT_OBJS=hstags.prl
13
14 SCRIPT_SUBST_VARS=\
15  INSTALLING \
16  TOP_PWD \
17  ProjectVersionInt
18
19 ifneq "$(BIN_DIST)" "1"
20 SCRIPT_SUBST_VARS += libdir libexecdir DEFAULT_TMPDIR
21 endif
22
23 #
24 # The hstags script is configured with different
25 # set of config variables, depending on whether it
26 # is to be installed or not.
27 #
28 ifeq "$(INSTALLING)" "1"
29 TOP_PWD := $(prefix)
30 ifeq "$(BIN_DIST)" "1"
31 SCRIPT_PREFIX_FILES += prefix.txt
32 endif
33 else
34 TOP_PWD := $(FPTOOLS_TOP_ABS)
35 HSP_IMPORTS:="$(TOP_PWD)/ghc/lib/ghc":"$(TOP_PWD)/ghc/lib/required":"$(TOP_PWD)/ghc/lib/glaExts":"$(TOP_PWD)/ghc/lib/concurrent"
36 SCRIPT_SUBST_VARS += HSP_IMPORTS
37 endif
38
39 #
40 # no INTERP: do *not* want #! script stuck on the front
41 #
42 # what's the deal? I'll add it for now (and perhaps pay for it later :-)
43 #  -- SOF
44 INTERP=perl
45
46 #
47 # install setup
48 #
49 INSTALL_SCRIPTS+=$(SCRIPT_PROG)
50 INSTALL_LIBEXECS=$(C_PROG)
51
52 #
53 # Before really installing the script, we have to
54 # reconfigure it such that the paths it refers to,
55 # point to the installed utils.
56 #
57 install ::
58         @$(RM) $(SCRIPT_PROG)
59         @$(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
60
61 include $(TOP)/mk/target.mk
62
63
64 # Hack to re-create the in-situ build tree script after 
65 # having just installed it.
66 #
67 install ::
68         @$(RM) $(SCRIPT_PROG)
69         @$(MAKE) $(MFLAGS) BIN_DIST=0 $(SCRIPT_PROG)
70