HRR=/home/reprap
SLIC3R=$(HRR)/Slic3r/bin/slic3r
+SKEINFORGE=python $(HRR)/reprappro-software.git/skeinforge/skeinforge_application/skeinforge_utilities/skeinforge_craft.py
+
+CWD := $(shell pwd)
+PLAY ?= $(CWD)
+
+CONFIG=slic3r-config.ini
+
+USING_AUTOS ?= filamentspool
+AUTO_TOPLEVELS := $(foreach m,$(USING_AUTOS),$(shell $(PLAY)/toplevel-find $m))
+
+scads: $(addsuffix .auto.scad, $(AUTO_TOPLEVELS))
+stls: $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
default:
+-include .*.d
+
%.stl: %.scad
- openscad -o $@ $<
+ openscad -d .$@.d.tmp -o $*.tmp.stl $<
+ @rm -f $@
+ @sed -e 's/\.tmp\.stl:/.stl:/' <.$@.d.tmp >.$@.d
+ @rm .$@.d.tmp
+ mv -f $*.tmp.stl $@
+
+%.gcode: $(CONFIG) %.stl
+ $(SLIC3R) --load $^ --output $@.tmp
+ @mv -f $@.tmp $@
+
+#%.gcode: %.stl
+# $(SKEINFORGE) $<
+
+%.gcode: manual-gcode-generator %.m-g
+ $(PLAY)/$^ >$@.tmp && mv -f $@.tmp $@
+
+dovecliptest.stl: doveclip.scad
+
+%.auto.scad: $(PLAY)/toplevel-make Makefile $(PLAY)/toplevel-find
+ @echo ' write $@'
+ $< $@ >$@.tmp
+ @mv -f $@.tmp $@
-%.gcode: %.stl
- $(SLIC3R) --load slic3r-config.ini $< --output $@
+.PRECIOUS: %.stl %.gcode
+clean:
+ rm -f *~ *.stl *.auto.scad *.gcode .*.d