summaryrefslogtreecommitdiff
path: root/rules/build-package-way.mk
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 /rules/build-package-way.mk
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 'rules/build-package-way.mk')
-rw-r--r--rules/build-package-way.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 2497e298c2..00ce06572d 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -80,7 +80,7 @@ endif
else
# Build the ordinary .a library
$$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS)
- "$$(RM)" $$(RM_OPTS) $$@ $$@.contents
+ $$(call removeFiles,$$@ $$@.contents)
ifeq "$$($1_$2_SplitObjs)" "YES"
$$(FIND) $$(patsubst %.$$($3_osuf),%_$$($3_osuf)_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print >> $$@.contents
echo $$($1_$2_$3_NON_HS_OBJS) >> $$@.contents
@@ -92,7 +92,7 @@ ifeq "$$($1_$2_ArSupportsAtFile)" "YES"
else
"$$(XARGS)" $$(XARGS_OPTS) "$$($1_$2_AR)" $$($1_$2_AR_OPTS) $$($1_$2_EXTRA_AR_ARGS) $$@ < $$@.contents
endif
- "$$(RM)" $$(RM_OPTS) $$@.contents
+ $$(call removeFiles,$$@.contents)
endif
$(call all-target,$1_$2,all_$1_$2_$3)