[project @ 1997-09-05 09:16:19 by simonm]
[ghc-hetmet.git] / ghc / utils / stat2resid / Makefile
1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.8 1997/09/05 09:16:34 simonm 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 SCRIPT_SUBST_VARS=TMPDIR
20
21 INTERP=perl
22 CLEAN_FILES += $(SCRIPT_PROG)
23
24 #
25 # The stat2resid script is configured with a different
26 # path to the supporting perl scripts, depending on whether it
27 # is to be installed or not.
28 #
29 ifeq "$(INSTALLING)" "1"
30 ifeq "$(BIN_DIST)" "1"
31 SCRIPT_PREFIX_FILES += prefix.txt
32 endif
33 endif
34
35 #
36 # install setup
37
38 INSTALL_LIBS    += $(DYN_LOADABLE_BITS)
39 INSTALL_SCRIPTS += $(SCRIPT_PROG)
40
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 include $(TOP)/mk/target.mk
52
53 # Hack to re-create the in-situ build tree script after 
54 # having just installed it.
55 #
56 install ::
57         @$(RM) $(SCRIPT_PROG)
58         @$(MAKE) $(MFLAGS) $(SCRIPT_PROG)