chiark / gitweb /
Introduce i alias for mv $@
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Sep 2023 11:39:09 +0000 (12:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Sep 2023 11:39:09 +0000 (12:39 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
diziet-utils/reprap-objects.make

index b76ba162fd7eddc9122742fbaa8897205bed2636..8e727abc6cee5b7e8ee32ba259bf8825d8537b39 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,12 +61,12 @@ pandemic-counter%.stl: $(PANDEMICCOUNTER_DXFS)
 .PRECIOUS: pandemic-counter-l%.eps
 pandemic-counter-l%.eps: pandemic-counter-letters.fig
                fig2dev -D +$(notdir $*) -L eps <$< >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 .PRECIOUS: maglite-holder-torch-curve.eps
 maglite-holder-torch-curve.eps: maglite-holder-torch.fig
                fig2dev -D +1:70 -L eps <$< >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 maglite-holder-torch-curve.dxf: maglite-holder-torch-curve.eps
                pstoedit -dt -flat 0.05 -f "dxf: -polyaslines -mm" $< $@
@@ -84,11 +84,11 @@ pandemic-quarantine%.stl: $(PANDEMICQUARANTINES_DXFS)
 .PRECIOUS: pandemic-quarantine-l%.eps
 pandemic-quarantine-l%.eps: pandemic-quarantine-numbers.fig
                fig2dev -D +$(notdir $*) -L eps <$< >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 FILAMENTSPOOL_NUMBERS=$(shell seq 300 100 1500)
 filamentspool-number-n%.eps:   filamentspool-number.eps.pl
-       ./$< $* >$@.tmp && mv -f $@.tmp $@
+       ./$< $* >$@.tmp && $i
 
 FILAMENTSPOOL_DXFS=$(foreach n,$(FILAMENTSPOOL_NUMBERS), \
        filamentspool-number-n$n.dxf)
@@ -103,17 +103,17 @@ SCREWRECESSTEST_DXFS=$(foreach s,$(SCREWRECESSTEST_SIZES), \
        screw-recess-test-number-s$s.dxf)
 
 screw-recess-test-number-s%.fig: screw-recess-test-number.fig.pl
-       ./$< $* >$@.tmp && mv -f $@.tmp $@
+       ./$< $* >$@.tmp && $i
 
 screw-recess-test-number-s%.eps: screw-recess-test-number-s%.fig
                fig2dev -L eps <$< >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 screw-recess-test-numbers screw-recess-test.stl: $(SCREWRECESSTEST_DXFS)
 
 question-question.eps: question-question.fig
                fig2dev -L eps <$< >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 sewing-table%.stl: sewing-table-rear-profile.dxf
 sewing-table%.stl: sewing-table-front-profile.dxf
@@ -121,7 +121,7 @@ sewing-table%.stl: sewing-table-end-profile.dxf
 
 sewing-table-%-profile.eps: sewing-table-%-profile.fig
                fig2dev -L eps -D +40 <$< >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 question-token.stl: question-question.dxf
 
@@ -146,5 +146,5 @@ poster-tube-lid,CatchPostDistort-fa%.stl: \
                distort-stl poster-tube-lid,CatchPreDistort.auto.stl
        ./distort-stl <poster-tube-lid,CatchPreDistort.auto.stl \
                set-fa $(notdir $*) project-cylinder 100 >$@.tmp
-       mv -f $@.tmp $@
+       $i
 
index 9d9bf54c46bfc3bb4b41e456fc7e9ff98ed939e2..f212f9740ba03ff8454596d33c6d53dddc03e801 100644 (file)
@@ -40,6 +40,8 @@ stls:         $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
 %.auto.stls:
        $(MAKE) $(addsuffix .auto.stl, $(shell $(DUTILS)/toplevel-find $*))
 
+i=mv -f $@.tmp $@
+
 -include .*.d
 
 %.stl:         %.scad $(AUTO_INCS)
@@ -52,28 +54,28 @@ stls:               $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
 AUTOBASE=$(shell echo $(1) | perl -pe 's/,\w+\.auto$$//')
 
 %:             %.cpp
-               cpp -nostdinc -P <$< >$@.tmp && mv -f $@.tmp $@
+               cpp -nostdinc -P <$< >$@.tmp && $i
 
 funcs.scad:    diziet-utils/funcs.scad.cpp
-               cpp -nostdinc -P $< >$@.tmp && mv -f $@.tmp $@
+               cpp -nostdinc -P $< >$@.tmp && $i
 
 %.gcode:       manual-gcode-generator %.m-g
-               $(CWD)/$^ >$@.tmp && mv -f $@.tmp $@
+               $(CWD)/$^ >$@.tmp && $i
 
 %.dxf:         %.eps
                pstoedit -dt -f "dxf: -polyaslines -mm" $< $@
 
 %:             %.pl
-               ./$< >$@.tmp && mv -f $@.tmp $@
+               ./$< >$@.tmp && $i
 
 %:             %.m4
-               $(M4) -P >$@.tmp $< && mv -f $@.tmp $@
+               $(M4) -P >$@.tmp $< && $i
 
 .PRECIOUS: %.auto.scad
 %.auto.scad: $(DUTILS)/toplevel-make Makefile $(DUTILS)/toplevel-find
                @echo ' write $@'
                $< $@ >$@.tmp
-               @mv -f $@.tmp $@
+               @$i
 
 .PRECIOUS:     %.stl %.gcode %.eps %.dxf