[project @ 1997-03-20 22:21:55 by sof]
[ghc-hetmet.git] / ghc / utils / stat2resid / Makefile
1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.5 1997/03/20 22:21:55 sof Exp $
3
4 TOP=../..
5 include $(TOP)/mk/boilerplate.mk
6 WAYS=
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 SCRIPT_PATH
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 else
33 INSTLIBDIR_GHC:=$(libdir)
34 endif
35 else
36 INSTLIBDIR_GHC:=$(FPTOOLS_TOP_ABS)/ghc/utils/stat2resid
37 endif
38
39 #
40 # install setup
41
42 INSTALL_LIBS  += $(DYN_LOADABLE_BITS)
43 INSTALL_PROGS += $(SCRIPT_PROG)
44
45
46 #
47 # Before really installing the script, we have to
48 # reconfigure it such that the paths it refers to,
49 # point to the installed utils.
50 #
51 install ::
52         $(RM) $(SCRIPT_PROG)
53         $(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
54
55 include $(TOP)/mk/target.mk
56
57 # Hack to re-create the in-situ build tree script after 
58 # having just installed it.
59 #
60 install ::
61         @$(RM) $(SCRIPT_PROG)
62         @$(MAKE) $(MFLAGS) $(SCRIPT_PROG)