Added configuration option to output AMF or STL files based on the initial output.
authorJoseph Lenox <lenox.joseph@gmail.com>
Tue, 20 Jan 2015 23:12:11 +0000 (17:12 -0600)
committerJoseph Lenox <lenox.joseph@gmail.com>
Tue, 20 Jan 2015 23:12:11 +0000 (17:12 -0600)
Defaults to STL.

box_frame/Makefile

index 7b9f338..7168703 100644 (file)
@@ -1,22 +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)
 
 MODELS_EXTRAS = $(wildcard extras/*.scad)
 STL_EXTRAS_1 = $(foreach src, $(MODELS_EXTRAS),output/$(src))
-STL_EXTRAS = $(STL_EXTRAS_1:%.scad=%.stl)
+STL_EXTRAS = $(STL_EXTRAS_1:%.scad=%.$(OUTPUT_TYPE))
 
 extras: $(STL_EXTRAS)
 
-output/%.stl: %.scad $(INCLUDES) configuration.scad
+output/%.$(OUTPUT_TYPE): %.scad $(INCLUDES) configuration.scad
        openscad -o $@ $<
 
 clean:
-       rm output/*.stl output/*.gcode output/extras/*.stl output/extras/*.gcode
+       rm output/*.$(OUTPUT_TYPE) output/*.gcode output/extras/*.stl output/extras/*.gcode