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