e4af0ed35d3727c6b2f02833ffe511f44706d2e0
[ghc-hetmet.git] / ghc / utils / hscpp / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3
4 SCRIPT_PROG=hscpp
5 SCRIPT_OBJS=hscpp.prl
6 SCRIPT_SUBST_VARS=
7
8 ifneq "$(BIN_DIST)" "1"
9 SCRIPT_SUBST_VARS += RAWCPP
10 endif
11
12 # Note: might be overridden from cmd-line (see install rule below)
13 INSTALLING=0
14
15 # no INTERP: do *not* want #! script stuck on the front
16 # what's the deal? I'll add it for now  -- SOF
17 INTERP=perl
18
19 #
20 # install setup
21 #
22 INSTALL_LIB_SCRIPTS+=$(SCRIPT_PROG)
23 INSTALL_LIBEXECS=$(C_PROG)
24
25
26 #
27 # Before really installing the script, we have to
28 # reconfigure it such that the paths it refers to,
29 # point to the installed utils.
30 #
31 install ::
32         @$(RM) $(SCRIPT_PROG)
33         @$(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
34
35
36 CLEAN_FILES += $(SCRIPT_PROG)
37
38 include $(TOP)/mk/target.mk
39
40
41 # Hack to re-create the in-situ build tree script after 
42 # having just installed it.
43 #
44 install ::
45         @$(RM) $(SCRIPT_PROG)
46         @$(MAKE) $(MFLAGS) BIN_DIST=0 $(SCRIPT_PROG)
47