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

index 8e727abc6cee5b7e8ee32ba259bf8825d8537b39..b0903256cf3e5f257aea58652495be4cb78f6fc1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,7 @@ pandemic-quarantine-l%.eps: pandemic-quarantine-numbers.fig
 
 FILAMENTSPOOL_NUMBERS=$(shell seq 300 100 1500)
 filamentspool-number-n%.eps:   filamentspool-number.eps.pl
-       ./$< $* >$@.tmp && $i
+       ./$< $* $o
 
 FILAMENTSPOOL_DXFS=$(foreach n,$(FILAMENTSPOOL_NUMBERS), \
        filamentspool-number-n$n.dxf)
@@ -103,7 +103,7 @@ 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 && $i
+       ./$< $* $o
 
 screw-recess-test-number-s%.eps: screw-recess-test-number-s%.fig
                fig2dev -L eps <$< >$@.tmp
index f212f9740ba03ff8454596d33c6d53dddc03e801..d47a23cfc735040cc73b40466e0298f4f11d99fa 100644 (file)
@@ -41,6 +41,7 @@ stls:         $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
        $(MAKE) $(addsuffix .auto.stl, $(shell $(DUTILS)/toplevel-find $*))
 
 i=mv -f $@.tmp $@
+o= >$@.tmp && $i
 
 -include .*.d
 
@@ -54,19 +55,19 @@ i=mv -f $@.tmp $@
 AUTOBASE=$(shell echo $(1) | perl -pe 's/,\w+\.auto$$//')
 
 %:             %.cpp
-               cpp -nostdinc -P <$< >$@.tmp && $i
+               cpp -nostdinc -P <$< $o
 
 funcs.scad:    diziet-utils/funcs.scad.cpp
-               cpp -nostdinc -P $< >$@.tmp && $i
+               cpp -nostdinc -P $< $o
 
 %.gcode:       manual-gcode-generator %.m-g
-               $(CWD)/$^ >$@.tmp && $i
+               $(CWD)/$^ $o
 
 %.dxf:         %.eps
                pstoedit -dt -f "dxf: -polyaslines -mm" $< $@
 
 %:             %.pl
-               ./$< >$@.tmp && $i
+               ./$< $o
 
 %:             %.m4
                $(M4) -P >$@.tmp $< && $i