Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
export ROOT ?= $(abspath $(shell pwd)/..)
export OUTPUT ?= $(ROOT)/output
SCADS = $(wildcard *.scad)
SCAD_MODULES != grep "module sff_" $(SCADS) | awk -F\( '{print $$1}' | awk '{print $$2}'
SCAD_MDS = $(addsuffix .md, $(SCADS))
STLS = $(addprefix stls/, $(addsuffix .stl, $(SCAD_MODULES)))
STL_INCLUDES=$(foreach s,$(SCADS),include <$(s)>\n)
ifeq ($(SCAD_MDS),)
$(info Warning: no SCAD markdown targets found. This Makefile.scads is for individual module directories. Did you mean to use Makefile?)
endif
all: $(SCAD_MDS) $(STLS)
include $(wildcard *.deps)
%.scad.md: %.stl
mkdir -p images/$*
openscad-docsgen -D . -f -m $*.scad
cp -au $@ $(OUTPUT)
-cp -au spec_images/* images/$*
-cp -au images/* $(OUTPUT)/images
stls/%.stl: $(SCADS)
mkdir -p stls
echo "$(STL_INCLUDES)\n\$$fs=0.3;\n$*();\n" | openscad -q -o $@ -
cp -au $@ $(OUTPUT)/stls/
%.stl: %.scad
openscad -D"MAKE=true" -D'$$fs=0.3' --hardwarnings --export-format stl -o $@ -m make -d $@.gen $<
# fix generated deps file to compensate for WSL2 pathing YES I KNOW THIS IS ONLY A "ME" PROBLEM
cat $@.gen \
| sed -e 's%\\%=%' \
| sed -re "s%(C:/\S+)(.+)%echo -n '\t'; wslpath -u \1 | tr -d '\n' ; echo -n '' \2%e" \
| sed -e "s%=%\\\\%" > $@.deps
-rm $@.gen
%.scad:
clean:
rm -rf *.deps *.gen *.stl *.scad.md images stls
.PHONY: clean
.SECONDARY:
84f8c4d50This file is pinned to the selected release. Download the original to open it in your design tool.