x-end: initial import of prusa mk3 belt tensioner
[clinton/prusa3.git] / box_frame / Makefile
index 7d56c63..7168703 100644 (file)
@@ -1,16 +1,24 @@
 #openscad -o output/bushing.stl bushing.scad
 
+# Type of 3D Model file to output. Known to work with AMF or STL.
+OUTPUT_TYPE=stl
 INCLUDES = $(wildcard inc/*.scad)
 
 MODELS = $(filter-out configuration.scad, $(wildcard *.scad))
 
 STL_FILES_1 = $(foreach src, $(MODELS),output/$(src))
-STL_FILES = $(STL_FILES_1:%.scad=%.stl)
+STL_FILES = $(STL_FILES_1:%.scad=%.$(OUTPUT_TYPE))
 
 all: $(STL_FILES)
 
-output/%.stl: %.scad $(INCLUDES) configuration.scad
+MODELS_EXTRAS = $(wildcard extras/*.scad)
+STL_EXTRAS_1 = $(foreach src, $(MODELS_EXTRAS),output/$(src))
+STL_EXTRAS = $(STL_EXTRAS_1:%.scad=%.$(OUTPUT_TYPE))
+
+extras: $(STL_EXTRAS)
+
+output/%.$(OUTPUT_TYPE): %.scad $(INCLUDES) configuration.scad
        openscad -o $@ $<
 
 clean:
-       rm output/*.stl output/*.gcode
+       rm output/*.$(OUTPUT_TYPE) output/*.gcode output/extras/*.stl output/extras/*.gcode