FIX Trac 1888; duplicate INLINE pragmas
[ghc-hetmet.git] / driver / ghci / Makefile
1 #-----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.11 2005/05/05 00:58:38 sof Exp $
3 #
4
5 TOP=../..
6 include $(TOP)/mk/boilerplate.mk
7
8 # -----------------------------------------------------------------------------
9 # ghci script
10
11 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
12 C_PROG = ghci
13 C_OBJS += ghci.res
14 else
15 C_SRCS=
16 endif
17
18 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
19 INSTALL_PROGS    += $(C_PROG)
20 GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh
21 install::
22         $(RM) -f $(GHCII_SCRIPT)
23         echo "#!$(SHELL)"                                  >> $(GHCII_SCRIPT)
24         echo 'exec "$$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT)
25 else
26 LINK = ghci
27 LINK_TARGET = $(LINK)-$(ProjectVersion)
28 INSTALLED_SCRIPT=$(DESTDIR)$(bindir)/$(LINK_TARGET)
29 install::
30         $(RM) -f $(INSTALLED_SCRIPT)
31         echo "#!$(SHELL)"                                          >> $(INSTALLED_SCRIPT)
32         echo "GHCBIN=$(libexecdir)/ghc-$(ProjectVersion)"          >> $(INSTALLED_SCRIPT)
33         echo "TOPDIROPT=-B$(libdir)"                               >> $(INSTALLED_SCRIPT)
34         echo 'exec $$GHCBIN $$TOPDIROPT --interactive $${1+"$$@"}' >> $(INSTALLED_SCRIPT)
35         $(EXECUTABLE_FILE) $(INSTALLED_SCRIPT)
36 endif
37
38 ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
39 INPLACE_SCRIPT=ghci-inplace
40 CLEAN_FILES += $(INPLACE_SCRIPT)
41 all::
42         $(RM) -f $(INPLACE_SCRIPT)
43         echo "#!$(SHELL)"                                                              >> $(INPLACE_SCRIPT)
44         echo "GHCBIN=$(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)/ghc-$(ProjectVersion)" >> $(INPLACE_SCRIPT)
45         echo "TOPDIROPT=$(FPTOOLS_TOP_ABS)"                                            >> $(INPLACE_SCRIPT)
46         echo 'exec $$GHCPKGBIN --global-conf $$PKGCONF $${1+"$$@"}'                    >> $(INPLACE_SCRIPT)
47         $(EXECUTABLE_FILE) $(INPLACE_SCRIPT)
48 endif
49
50 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
51 ghci.res : ghci.rc ghci.ico
52         windres --preprocessor="$(CPP) -xc -DRC_INVOKED" -o ghci.res -i ghci.rc -O coff
53 endif
54
55 binary-dist:
56         $(INSTALL_DIR)           $(BIN_DIST_DIR)/driver/ghci
57         $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/driver/ghci/
58
59 include $(TOP)/mk/target.mk