X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rules%2Fshell-wrapper.mk;h=acdb06e72d86243f19220fc6c9fb8d46f5a40827;hb=0bde11509ca13d4d0914496ee652d7c2b43a0420;hp=a2aca45e3636ba6fdf2b0e27ad0517723df2ec1d;hpb=34cc75e1a62638f2833815746ebce0a9114dc26b;p=ghc-hetmet.git diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk index a2aca45..acdb06e 100644 --- a/rules/shell-wrapper.mk +++ b/rules/shell-wrapper.mk @@ -1,10 +1,22 @@ +# ----------------------------------------------------------------------------- +# +# (c) 2009 The University of Glasgow +# +# This file is part of the GHC build system. +# +# To understand how the build system works and how to modify it, see +# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture +# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying +# +# ----------------------------------------------------------------------------- + define shell-wrapper # $1 = dir # $2 = distdir ifeq "$$($1_$2_SHELL_WRAPPER)" "YES" -ifeq "$(Windows)" "YES" +ifeq "$$(Windows)" "YES" ifeq "$$($1_$2_INSTALL_SHELL_WRAPPER)" "YES" # Just install the binary on Windows @@ -21,11 +33,11 @@ ifneq "$$($1_$2_INSTALL_INPLACE)" "NO" all_$1_$2 : $$(INPLACE_BIN)/$$($1_$2_PROG) $$(INPLACE_BIN)/$$($1_$2_PROG): $$($1_$2_INPLACE) - $$(RM) -f $$@ + "$$(RM)" $$(RM_OPTS) $$@ echo '#!$$(SHELL)' >> $$@ - echo 'executablename=$$(TOP)/$$<' >> $$@ - echo 'datadir=$$(TOP)/$$(INPLACE_LIB)' >> $$@ - echo 'bindir=$$(TOP)/$$(INPLACE_BIN)' >> $$@ + echo 'executablename=$$(TOP)/$$<' >> $$@ + echo 'datadir=$$(TOP)/$$(INPLACE_LIB)' >> $$@ + echo 'bindir=$$(TOP)/$$(INPLACE_BIN)' >> $$@ cat $$($1_$2_SHELL_WRAPPER_NAME) >> $$@ $$(EXECUTABLE_FILE) $$@ endif @@ -45,8 +57,8 @@ install: install_$1_$2_wrapper .PHONY: install_$1_$2_wrapper install_$1_$2_wrapper: WRAPPER=$$(DESTDIR)$$(bindir)/$$($1_$2_INSTALL_SHELL_WRAPPER_NAME) install_$1_$2_wrapper: - $$(MKDIRHIER) $$(DESTDIR)$$(bindir) - $$(RM) -f $$(WRAPPER) + "$$(MKDIRHIER)" $$(DESTDIR)$$(bindir) + "$$(RM)" $$(RM_OPTS) $$(WRAPPER) echo '#!$$(SHELL)' >> $$(WRAPPER) echo 'executablename=$$(libexecdir)/$$($1_$2_PROG)' >> $$(WRAPPER) echo 'datadir=$$(datadir)' >> $$(WRAPPER)