From 1b003081b689d0f999e6123cc330bb94d6aa6662 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 15 Jan 2023 20:47:24 +0100 Subject: Makefile, readme --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ README.md | 9 +++++++++ 2 files changed, 46 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a47a419 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +SCAD=openscad + +STLOPTS= --export-format binstl +PNGOPTS= --viewall --autocenter --imgsize 400,400 --render + +SRC = $(wildcard *.scad) + +STL = $(SRC:.scad=.stl) +PNG = $(SRC:.scad=.png) + +_default: stl + +all: clean stl png + +stl: $(STL) + +gridfinity.stl: gridfinity.scad + @echo + +%.stl: %.scad + @echo [ STL ] $< + @$(SCAD) $(STLOPTS) -o $@ $< + + +png: $(PNG) + +gridfinity.png: gridfinity.scad + @echo + +%.png: %.scad + @echo [ PNG ] $< + @$(SCAD) $(SCADOPTS) -o $@ $< + +.PHONY: clean +clean: + @rm -f *.stl + @rm -f *.png diff --git a/README.md b/README.md index c64f62f..d3326c7 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,15 @@ use gridfinity(2, 1, 2, lip=true, magnets=false); ``` +## Building + +STLs and PNGs can be built with GNU make by just running +`make stl` and `make png` +respectively. + +T build a single object, use the desired file as a target: +`make example.stl` + ## License Licensed under the MIT License. Consult `LICENSE`. -- cgit v1.2.3