11OPENSCAD =/usr/bin/openscad
22OPENSCAD_OPTIONS =-q
3+ STL_SORTER =lib/sort_stl.py
34IMAGE_OPTIONS=--imgsize =1024,768 --colorscheme "Tomorrow Night" --render true -D orient_for_printing=false
45THUMBNAIL_OPTIONS=--imgsize =400,300 --colorscheme "Tomorrow Night" --render true -D fast=true -D orient_for_printing=false
56
7+ SHELL =bash
8+
69SRCS =$(wildcard src/* /* .scad)
710STLS =$(patsubst src/% .scad,export/% .stl,$(SRCS ) )
811PNGS =$(patsubst src/% .scad,render/% .png,$(SRCS ) )
2629export/% .stl : src/% .scad
2730 @mkdir -p $(shell dirname $@ )
2831 $(OPENSCAD ) $(OPENSCAD_OPTIONS ) -D orient_for_printing=true -o $@ $<
32+ $(STL_SORTER ) $@
2933
3034export-all : $(STLS )
3135
@@ -50,10 +54,10 @@ render/assembly.gif: assembly.scad $(SRCS)
5054# $3: logo part (main|highlight)
5155# $4: logo mode (normal|inverted)
5256define logo-part-rule
53- export /logo/$(1)/$(shell basename $(2))-$(4)-$(3).stl: src/$(2).scad logo/$(1)/$(shell basename $(2)).svg
57+ export /logo/$(1)/$(shell basename $(2))-$(4)-$(3).stl: src/$(2).scad logo/$(1)/$(shell basename $(2)).svg export/$(2).stl
5458 @mkdir -p $$(shell dirname $$@ )
55- $$(OPENSCAD ) $$(OPENSCAD_OPTIONS ) -D orient_for_printing=true -D logo_enabled=true -D 'logo_mode="$(4 ) "' -D 'logo_part="$(3 ) "' -D 'logo_name="$(1 ) "' -o $$@ $$<
56-
59+ $$(OPENSCAD ) $$(OPENSCAD_OPTIONS ) -D orient_for_printing=true -D logo_enabled=true -D logo_use_prebuild=true -D 'logo_mode="$(4 ) "' -D 'logo_part="$(3 ) "' -D 'logo_name="$(1 ) "' -o $$@ $$<
60+ $$( STL_SORTER ) $$@
5761logo-$1-$4: export/logo/$(1 ) /$(shell basename $(2 ) ) -$(4 ) -$(3 ) .stl
5862logo-$1: export/logo/$(1 ) /$(shell basename $(2 ) ) -$(4 ) -$(3 ) .stl
5963logos: logo-$1
7882
7983$(foreach file,$(FILES_WITH_LOGO), \
8084 $(eval $(call logo-template-rule,$(file))))
85+
86+
87+ define numbered-cover-rule
88+ export /Mounting/AttachmentCover_$(1).stl: src/Mounting/AttachmentCover.scad
89+ @mkdir -p $$(shell dirname $$@ )
90+ $(OPENSCAD ) $(OPENSCAD_OPTIONS ) -D orient_for_printing=true -D attachment_cover_number_text=$(1 ) -o $$@ $$<
91+ $(STL_SORTER ) $@
92+ endef
93+
94+ $(foreach number,$(shell seq 0 1 100), \
95+ $(eval $(call numbered-cover-rule,$(number))))
0 commit comments