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>
reprap-objects.make

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