929b870716ccc2a44ce8ca4b737234f647a07e9d
[ghc-hetmet.git] / ghc / utils / stat2resid / Makefile
1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.9 1998/02/04 20:56:24 sof Exp $
3
4 TOP=../..
5 include $(TOP)/mk/boilerplate.mk
6
7 DYN_LOADABLE_BITS = \
8         parse-gcstats.prl \
9         process-gcstats.prl
10
11 SCRIPT_PROG=stat2resid
12 SCRIPT_OBJS=stat2resid.prl
13
14 #
15 # Could be overridden from the cmd line (see install rule below).
16 #
17 INSTALLING=0
18
19 ifneq "$(BIN_DIST)" "1"
20 SCRIPT_SUBST_VARS=TMPDIR
21 endif
22
23 INTERP=perl
24 CLEAN_FILES += $(SCRIPT_PROG)
25
26 #
27 # The stat2resid script is configured with a different
28 # path to the supporting perl scripts, depending on whether it
29 # is to be installed or not.
30 #
31 ifeq "$(INSTALLING)" "1"
32 ifeq "$(BIN_DIST)" "1"
33 SCRIPT_PREFIX_FILES += prefix.txt
34 endif
35 endif
36
37 #
38 # install setup
39
40 INSTALL_LIBS    += $(DYN_LOADABLE_BITS)
41 INSTALL_SCRIPTS += $(SCRIPT_PROG)
42
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 include $(TOP)/mk/target.mk
54
55 # Hack to re-create the in-situ build tree script after 
56 # having just installed it.
57 #
58 install ::
59         @$(RM) $(SCRIPT_PROG)
60         @$(MAKE) $(MFLAGS) $(SCRIPT_PROG)