summaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-11-19 01:29:05 +0000
committerIan Lynagh <igloo@earth.li>2011-11-19 01:52:32 +0000
commit80e9070c77718b7ff0e913182e54842754726ce8 (patch)
tree12804916372a3675a7d1beb00bd41e70083c5edf /libffi
parent042841713eb6468696eeb437de994c52eb7a858e (diff)
downloadhaskell-80e9070c77718b7ff0e913182e54842754726ce8.tar.gz
Improve the way we call "rm" in the build system; fixes trac #4916
We avoid calling "rm -rf" with no file arguments; this fixes cleaning on Solaris, where that fails. We also check for suspicious arguments: anything containing "..", starting "/", or containing a "*" (you need to call $(wildcard ...) yourself now if you really want globbing). This should make things a little safer.
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ghc.mk16
1 files changed, 8 insertions, 8 deletions
diff --git a/libffi/ghc.mk b/libffi/ghc.mk
index 48c71bc8ce..d777c7877a 100644
--- a/libffi/ghc.mk
+++ b/libffi/ghc.mk
@@ -40,13 +40,13 @@ endif
ifneq "$(BINDIST)" "YES"
$(libffi_STAMP_CONFIGURE):
- "$(RM)" $(RM_OPTS) $(libffi_STAMP_STATIC_CONFIGURE)
- "$(RM)" $(RM_OPTS) $(libffi_STAMP_STATIC_BUILD)
- "$(RM)" $(RM_OPTS) $(libffi_STAMP_STATIC_INSTALL)
- "$(RM)" $(RM_OPTS) $(libffi_STAMP_STATIC_SHARED_CONFIGURE)
- "$(RM)" $(RM_OPTS) $(libffi_STAMP_STATIC_SHARED_BUILD)
- "$(RM)" $(RM_OPTS) $(libffi_STAMP_STATIC_SHARED_INSTALL)
- "$(RM)" $(RM_OPTS_REC) $(LIBFFI_DIR) libffi/build
+ $(call removeFiles,$(libffi_STAMP_STATIC_CONFIGURE))
+ $(call removeFiles,$(libffi_STAMP_STATIC_BUILD))
+ $(call removeFiles,$(libffi_STAMP_STATIC_INSTALL))
+ $(call removeFiles,$(libffi_STAMP_STATIC_SHARED_CONFIGURE))
+ $(call removeFiles,$(libffi_STAMP_STATIC_SHARED_BUILD))
+ $(call removeFiles,$(libffi_STAMP_STATIC_SHARED_INSTALL))
+ $(call removeTrees,$(LIBFFI_DIR) libffi/build)
cat ghc-tarballs/libffi/libffi*.tar.gz | $(GZIP_CMD) -d | { cd libffi && $(TAR_CMD) -xf - ; }
mv libffi/libffi-* libffi/build
@@ -95,7 +95,7 @@ $(ffi_HEADER): $(libffi_STAMP_INSTALL) | $$(dir $$@)/.
cp libffi/build/inst/lib/libffi-*/include/ffi.h $@
$(eval $(call clean-target,libffi,, \
- libffi/build libffi/stamp.ffi.* libffi/dist-install))
+ libffi/build $(wildcard libffi/stamp.ffi.*) libffi/dist-install))
endif