chiark / gitweb /
sort out toplevels
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 6 Nov 2017 00:24:27 +0000 (00:24 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 6 Nov 2017 00:24:27 +0000 (00:24 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
Makefile
moebius.scad [moved from moebius-demo.scad with 98% similarity]

index 62075e7ccbd19516abba21b78a26f009a64d775d..9209c6c26f884bc2d4506de94e59d757f1dfb688 100644 (file)
@@ -3,3 +3,4 @@ moebius-core.scad
 *.gcode
 commitid.scad
 *.tmp
+*.auto.scad
index 0e3f0242aedf740ef4a2ebb8096091439a830338..d0075d8bfae41b472afeabf34b4102fc41a9b7d9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,29 @@
 all: moebius-core.scad
 
 PLAY = /home/reprap/play
+USING_AUTOS = moebius
 
 $(shell set -xe; $(PLAY)/commitid.scad.pl >commitid.scad.tmp; cmp commitid.scad.tmp commitid.scad || mv -f commitid.scad.tmp commitid.scad )
 
 moebius-core.scad: genscad moebius.py
                ./$< >$@.tmp && mv -f $@.tmp $@
+
+AUTO_TOPLEVELS := $(foreach m,$(USING_AUTOS),$(shell $(PLAY)/toplevel-find $m))
+
+autoincs:      $(AUTO_INCS)
+scads:         $(addsuffix .auto.scad, $(AUTO_TOPLEVELS))
+stls:          $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
+
+%.auto.scads: %.scad
+       $(MAKE) $(addsuffix .auto.scad, $(shell $(PLAY)/toplevel-find $*))
+%.auto.stls:
+       $(MAKE) $(addsuffix .auto.stl, $(shell $(PLAY)/toplevel-find $*))
+
+.PRECIOUS: %.auto.scad
+%.auto.scad: $(PLAY)/toplevel-make Makefile $(PLAY)/toplevel-find
+               @echo ' write $@'
+               $< $@ >$@.tmp
+               @mv -f $@.tmp $@
+
+.PRECIOUS:     %.stl %.gcode %.eps %.dxf
+
similarity index 98%
rename from moebius-demo.scad
rename to moebius.scad
index b8c82d5311a46b03d04a2219144ad2de61691cd9..41031a11fbba328d3ab463e2fdcd3bf2f3dfbda6 100644 (file)
@@ -158,7 +158,7 @@ module Kit(){ ////toplevel
     Pin();
 }
 
-module TestKit(){
+module TestKit(){ ////toplevel
   intersection(){
     Kit();
     cube([500,500,15], center=true);
@@ -175,4 +175,4 @@ module TestKit(){
 //Bottom();
 //Kit();
 //Demo();
-TestKit();
+//TestKit();