PRINTER := anycubic_i3_mega_s PRINTER_CONFIG := $(PRINTER:%=mech/prusa-slicer/%.ini) MECH_BUILD_DIR := $(BUILD_DIR)/mech PARTS := bottom top back front pcb_case/nut_tolerance_test pcb_case/bolt_tolerance_test pcb_case/panel_thickness_tolerance_test STL := $(PARTS:%=$(MECH_BUILD_DIR)/%.stl) GCODE := $(PARTS:%=$(MECH_BUILD_DIR)/%.gcode) .PHONY: mech mech: $(GCODE) $(BUILD_DIR)/%.gcode: $(BUILD_DIR)/%.stl mkdir -p $(dir $@) prusa-slicer --load $(PRINTER_CONFIG) --output $@ --export-gcode $< $(BUILD_DIR)/%.stl: %.scad mkdir -p $(dir $@) openscad --hardwarnings --export-format binstl -o $@ $< .PHONY: clean clean: rm -rf $(BUILD_DIR)