aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2014-04-16 22:15:54 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2014-04-16 22:15:54 +0200
commiteef01b05f5c7cab0613d83bfbc6738354a2a862d (patch)
tree0715eebaa47142acc1dff6f49e350f8356c6c679
parentc0f911077ee4bbe34eaa825cb2a17e23e4f4c50d (diff)
Makefile: added gcode and cleanup targets
-rw-r--r--Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 15dbb0c..2cb50fe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,27 @@
-BUILDDIR=build
-SRCDIR=parts
+BUILDDIR = build
+CONFDIR = conf
+SRCDIR = parts
-VPATH = $(SRCDIR)
+SLIC3R = ~/opt/Slic3r/bin/slic3r
+
+VPATH = $(SRCDIR):$(BUILDDIR)
STL_TARGETS = $(patsubst $(SRCDIR)/%.scad,$(BUILDDIR)/%.stl,$(wildcard $(SRCDIR)/*.scad))
+GCODE_TARGETS = $(patsubst $(SRCDIR)/%.scad,$(BUILDDIR)/%.gcode,$(wildcard $(SRCDIR)/*.scad))
+.PHONY: all gcode clean
all: $(STL_TARGETS)
+gcode: $(GCODE_TARGETS)
+
$(BUILDDIR)/%.stl: %.scad
mkdir -p ${BUILDDIR}
openscad -o $@ $^
+
+$(BUILDDIR)/%.gcode: %.stl
+ ${SLIC3R} --load ${CONFDIR}/connectors.ini $^
+
+clean:
+ rm -f ${BUILDDIR}/*.stl ${BUILDDIR}/*.gcode
+