aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-10-30 16:10:40 +0100
committerGaëtan Gilbert2019-10-30 16:11:12 +0100
commitfe61f673dfdba1598842b9d56a761c5229aaf4e9 (patch)
tree7f8944287a502bde0df44c81f188cfe4f59cd32c
parentdbcdc4e53758339d2a7eb96d19fbcffeb143154d (diff)
make: guard cp calls with rm -f on executables
Fix #10728
-rw-r--r--Makefile.checker2
-rw-r--r--Makefile.ide8
2 files changed, 4 insertions, 6 deletions
diff --git a/Makefile.checker b/Makefile.checker
index 5c55ccf489..90c73a496d 100644
--- a/Makefile.checker
+++ b/Makefile.checker
@@ -43,7 +43,7 @@ checker/check.cmxa $(LIBCOQRUN) checker/coqchk.mli checker/coqchk.ml
$(CODESIGN_HIDE) $@
else
$(CHICKEN): $(CHICKENBYTE)
- cp $< $@
+ rm -f $@ && cp $< $@
endif
$(CHICKENBYTE): config/config.cma clib/clib.cma lib/lib.cma kernel/kernel.cma \
diff --git a/Makefile.ide b/Makefile.ide
index 39c6c8ad1e..bd72494289 100644
--- a/Makefile.ide
+++ b/Makefile.ide
@@ -110,7 +110,7 @@ $(COQIDE): $(LINKIDEOPT)
$(STRIP_HIDE) $@
else
$(COQIDE): $(COQIDEBYTE)
- cp $< $@
+ rm -f $@ && cp $< $@
endif
$(COQIDEBYTE): $(LINKIDE)
@@ -119,9 +119,7 @@ $(COQIDEBYTE): $(LINKIDE)
-linkpkg -package str,unix,dynlink,threads,lablgtk3-sourceview3 $(IDEFLAGS) $(IDECDEPSFLAGS) $^
ide/coqide_os_specific.ml: ide/coqide_$(IDEINT).ml.in config/Makefile
- @rm -f $@
- cp $< $@
- @chmod a-w $@
+ rm -f $@ && cp $< $@ && chmod a-w $@
ide/%.cmi: ide/%.mli
$(SHOW)'OCAMLC $<'
@@ -150,7 +148,7 @@ IDETOPCMX:=$(IDETOPCMA:.cma=.cmxa)
# Special rule for coqidetop
$(IDETOPEXE): $(IDETOP:.opt=.$(BEST))
- cp $< $@
+ rm -f $@ && cp $< $@
$(IDETOP): ide/idetop.ml $(LINKCMX) $(LIBCOQRUN) $(IDETOPCMX)
$(SHOW)'COQMKTOP -o $@'