2 include $(TOP)/mk/boilerplate.mk
4 SRC_HC_OPTS += -package ghc
8 # On Windows, ghc-pkg is a standalone program
9 # ($bindir/ghc-pkg.exe), whereas on Unix it needs a wrapper script
10 # to pass the appropriate flag to the real binary
11 # ($libexecdir/ghc-pkg.bin) so that it can find package.conf.
12 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
14 INSTALL_PROGS += $(HS_PROG)
17 INSTALL_LIBEXECS += $(HS_PROG)
20 # -----------------------------------------------------------------------------
21 # ghctags and ghctags-inplace scripts
23 # See commentary in ../ghc-pkg/Makefile
25 INPLACE_HS=ghctags-inplace.hs
26 INPLACE_PROG=ghctags-inplace
27 EXCLUDED_SRCS+=$(INPLACE_HS)
29 $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk
30 echo "import System.Cmd; import System.Environment; import System.Exit" > $@
31 echo "main = do args <- getArgs; rawSystem \"$(FPTOOLS_TOP_ABS)/$(GHC_GHCTAGS_DIR_REL)/$(HS_PROG)\" (\"--topdir\":\"$(FPTOOLS_TOP_ABS)\":args) >>= exitWith" >> $@
33 $(INPLACE_PROG): $(INPLACE_HS)
36 all :: $(INPLACE_PROG)
38 CLEAN_FILES += $(INPLACE_HS) $(INPLACE_PROG)
40 ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
42 LINK_TARGET = $(LINK)-$(ProjectVersion)
43 INSTALLED_SCRIPT=$(DESTDIR)$(bindir)/$(LINK_TARGET)
45 $(INSTALL_DIR) $(DESTDIR)$(bindir)
46 $(RM) -f $(INSTALLED_SCRIPT)
47 echo "#!$(SHELL)" >> $(INSTALLED_SCRIPT)
48 echo "GHCTAGSBIN=$(libexecdir)/$(HS_PROG)" >> $(INSTALLED_SCRIPT)
49 echo "TOPDIR=$(libdir)" >> $(INSTALLED_SCRIPT)
50 echo 'exec $$GHCTAGSBIN --topdir $$TOPDIR $${1+"$$@"}' >> $(INSTALLED_SCRIPT)
51 $(EXECUTABLE_FILE) $(INSTALLED_SCRIPT)
55 $(INSTALL_DIR) $(BIN_DIST_DIR)/utils/ghctags
56 $(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/utils/ghctags/
57 $(INSTALL_PROGRAM) $(HS_PROG) $(BIN_DIST_DIR)/utils/ghctags/
59 include $(TOP)/mk/target.mk