[project @ 1997-03-20 22:21:55 by sof]
[ghc-hetmet.git] / ghc / utils / mkdependHS / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3 INSTALLING=0
4
5 WAYS=
6
7 boot :: all
8
9 SCRIPT_PROG=mkdependHS
10 SCRIPT_OBJS=mkdependHS.prl
11 SCRIPT_SUBST_VARS= \
12  RAWCPP TMPDIR UNLIT_PROG \
13  TOP_PWD \
14  INSTALL_LIB_DIR INSTALL_DATA_DIR \
15  INSTALL_HSLIBS_DIR INSTALLING \
16  PRELUDE_DIRS \
17  PROJECTVERSION SED
18
19 INTERP=perl
20
21 #
22 # install setup
23 #
24 INSTALL_PROGS += $(SCRIPT_PROG)
25
26 INSTALL_HSLIBS_DIR:=$(libdir)/../hslibs-$(ProjectVersion)
27 INSTALL_LIB_DIR:=$(libdir)
28 INSTALL_DATA_DIR:=$(datadir)
29
30 ifeq "$(INSTALLING)" "1"
31 TOP_PWD:=$(prefix)
32 UNLIT_PROG:=$(libexecdir)/unlit
33 PRELUDE_DIRS:=$(libdir)/imports
34 else
35 TOP_PWD:=$(FPTOOLS_TOP_ABS)
36 UNLIT_PROG:=$(FPTOOLS_TOP_ABS)/ghc/utils/unlit/unlit
37 PRELUDE_DIRS:="$(FPTOOLS_TOP_ABS)/ghc/lib/ghc:$(FPTOOLS_TOP_ABS)/ghc/lib/required:$(FPTOOLS_TOP_ABS)/ghc/lib/glaExts:$(FPTOOLS_TOP_ABS)/ghc/lib/concurrent"
38 endif
39
40 #
41 # Before really installing the script, we have to
42 # reconfigure it such that the paths it refers to,
43 # point to the installed utils.
44 #
45 install ::
46         $(RM) $(SCRIPT_PROG)
47         $(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
48
49 CLEAN_FILES += $(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)