[project @ 1997-03-13 09:15:06 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 # install setup
22 #
23 INSTALL_PROGS += $(SCRIPT_PROG)
24
25 INSTALL_HSLIBS_DIR:=$(libdir)/../hslibs-$(ProjectVersion)
26 INSTALL_LIB_DIR:=$(libdir)
27 INSTALL_DATA_DIR:=$(datadir)
28
29 ifeq "$(INSTALLING)" "1"
30 TOP_PWD:=$(prefix)
31 UNLIT_PROG:=$(libexecdir)/unlit
32 PRELUDE_DIRS:=$(libdir)/imports
33 else
34 TOP_PWD:=$(FPTOOLS_TOP_ABS)
35 UNLIT_PROG:=$(FPTOOLS_TOP_ABS)/ghc/utils/unlit/unlit
36 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"
37 endif
38
39 #
40 # Before really installing the script, we have to
41 # reconfigure it such that the paths it refers to,
42 # point to the installed utils.
43 #
44 install ::
45         $(RM) $(SCRIPT_PROG)
46         $(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
47
48 CLEAN_FILES += $(SCRIPT_PROG)
49
50 include $(TOP)/mk/target.mk
51
52 # Hack to re-create the in-situ build tree script after 
53 # having just installed it.
54 #
55 install ::
56         @$(RM) $(SCRIPT_PROG)
57         @$(MAKE) $(MFLAGS) $(SCRIPT_PROG)