Rename package-conf flags to package-db.
[ghc.git] / rules / shell-wrapper.mk
index 5df9ff2..a291d85 100644 (file)
@@ -11,6 +11,8 @@
 # -----------------------------------------------------------------------------
 
 define shell-wrapper
+$(call trace, shell-wrapper($1,$2))
+$(call profStart, shell-wrapper($1,$2))
 # $1 = dir
 # $2 = distdir
 
@@ -34,7 +36,7 @@ all_$1_$2 : $$(INPLACE_BIN)/$$($1_$2_PROG)
 
 $$(INPLACE_BIN)/$$($1_$2_PROG): WRAPPER=$$@
 $$(INPLACE_BIN)/$$($1_$2_PROG): $$($1_$2_INPLACE) $$($1_$2_SHELL_WRAPPER_NAME)
-       "$$(RM)" $$(RM_OPTS)                              $$@
+       $$(call removeFiles,                             $$@)
        echo '#!$$(SHELL)'                             >> $$@
        echo 'executablename="$$(TOP)/$$<"'            >> $$@
        echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"'       >> $$@
@@ -60,10 +62,10 @@ BINDIST_WRAPPERS += $$($1_$2_SHELL_WRAPPER_NAME)
 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: WRAPPER=$$(DESTDIR)$$(bindir)/$(CrossCompilePrefix)$$($1_$2_INSTALL_SHELL_WRAPPER_NAME)
 install_$1_$2_wrapper:
-       $$(INSTALL_DIR) "$$(DESTDIR)$$(bindir)"
-       "$$(RM)" $$(RM_OPTS)                                        "$$(WRAPPER)"
+       $$(call INSTALL_DIR,"$$(DESTDIR)$$(bindir)")
+       $$(call removeFiles,                                        "$$(WRAPPER)")
        $$(CREATE_SCRIPT)                                           "$$(WRAPPER)"
        echo '#!$$(SHELL)'                                       >> "$$(WRAPPER)"
        echo 'exedir="$$(ghclibexecdir)"'                        >> "$$(WRAPPER)"
@@ -72,7 +74,6 @@ install_$1_$2_wrapper:
        echo 'datadir="$$(datadir)"'                             >> "$$(WRAPPER)"
        echo 'bindir="$$(bindir)"'                               >> "$$(WRAPPER)"
        echo 'topdir="$$(topdir)"'                               >> "$$(WRAPPER)"
-       echo 'pgmgcc="$$(WhatGccIsCalled)"'                      >> "$$(WRAPPER)"
        $$($1_$2_SHELL_WRAPPER_EXTRA)
        $$($1_$2_INSTALL_SHELL_WRAPPER_EXTRA)
        cat $$($1_$2_SHELL_WRAPPER_NAME)                         >> "$$(WRAPPER)"
@@ -84,4 +85,5 @@ endif
 
 endif # $1_$2_SHELL_WRAPPER
 
+$(call profEnd, shell-wrapper($1,$2))
 endef