chiark / gitweb /
Makefile %.auto.{scads,stls} rule
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 18 Oct 2012 00:38:37 +0000 (01:38 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 18 Oct 2012 00:38:37 +0000 (01:38 +0100)
Makefile
toplevel-find

index 98ebc48987c80c3cdecc27b3eacceae423b3605b..2c677dc386c8b6ed1c2528ef20bc5b8a46da1b13 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,11 @@ AUTO_TOPLEVELS := $(foreach m,$(USING_AUTOS),$(shell $(PLAY)/toplevel-find $m))
 scads:         $(addsuffix .auto.scad, $(AUTO_TOPLEVELS))
 stls:          $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
 
+%.auto.scads:
+       $(MAKE) $(addsuffix .auto.scad, $(shell $(PLAY)/toplevel-find $*))
+%.auto.stls:
+       $(MAKE) $(addsuffix .auto.stl, $(shell $(PLAY)/toplevel-find $*))
+
 default:
 
 -include .*.d
index 227bb73a7989d0714b55abd78fbf83b8b63213a0..72d54a0180253e563997e0ebaca60da059b04207 100755 (executable)
@@ -3,7 +3,7 @@ use strict;
 @ARGV==1 or die;
 my $base = $ARGV[0];
 $base =~ m/^\-/ and die;
-open F, "$base.scad" or die $!;
+open F, "$base.scad" or die "$base.scad $!";
 while (<F>) {
       next unless m#^\s*module\s+(\w+)\b.*////toplevel\b#;
       print "$base,$1\n" or die $!;