From b2c7ad45e20526716b928883126331b4708f1eb3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 18 Oct 2012 01:38:37 +0100 Subject: [PATCH] Makefile %.auto.{scads,stls} rule --- Makefile | 5 +++++ toplevel-find | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 98ebc48..2c677dc 100644 --- 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 diff --git a/toplevel-find b/toplevel-find index 227bb73..72d54a0 100755 --- a/toplevel-find +++ b/toplevel-find @@ -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 () { next unless m#^\s*module\s+(\w+)\b.*////toplevel\b#; print "$base,$1\n" or die $!; -- 2.30.2