Last active
January 8, 2022 15:50
-
-
Save kenbarbour/5f26072ad35a5d717e3617a8159689dd to your computer and use it in GitHub Desktop.
Generic Makefile for OpenSCAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Makefile generates files for printing SCAD documents | |
# Copyright (C) 2016 Kenneth Barbour | kenbarbour.com | |
# License: GNU GPL v3 (or later) | |
## make all Generate STL for each SCAD file | |
## make gcode Generate gcode for each SCAD file | |
## SCAD Compiler | |
SCADC?=openscad | |
## Slicing program | |
SLICER?=slic3r | |
STL_TARGETS = $(patsubst %.scad,%.stl,$(wildcard *.scad)) | |
GCODE_TARGETS = $(patsubst %.scad,%.gcode,$(wildcard *.scad)) | |
.PHONY: all models gcode clean | |
all: models gcode | |
models: $(STL_TARGETS) | |
gcode: $(GCODE_TARGETS) | |
%.stl: %.scad | |
$(SCADC) -o $@ $< | |
%.gcode: %.stl | |
$(SLICER) $< -o $@ | |
clean: | |
rm -f *.stl *.gcode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EDIT: removed plater and plated models because slic3r automatically does this for you and plater was an ambigous project name.