The sad realization that STL import/export is not good enough to cache keyblanks

This commit is contained in:
Eric Van Albert
2017-06-17 21:37:31 -04:00
parent 42aa34d81c
commit af88866d69
6 changed files with 9 additions and 37 deletions

View File

@@ -1,13 +1,12 @@
# Makefile for keygen
# Executables
SCAD = OPENSCADPATH=src:build openscad
SCAD = openscad
POLY = PYTHONPATH=/usr/share/inkscape/extensions bin/paths2openscad.py
SCAD_DIR = src
SCAD_DIR = scad
SVG_DIR = resources
POLY_DIR = build
STL_DIR = build
POLY_DIR = scad
JSON_DIR = build
# Files to include
@@ -17,9 +16,6 @@ SCAD_SRC = $(SCAD_DIR)/schlage.scad
# Generated polygon files
POLY_OBJ = $(patsubst $(SVG_DIR)/%.svg,$(POLY_DIR)/%.gen.scad,$(SVG_SRC))
# Generated STL
STL_OBJ = # populated in .d files
# Generated JSON files
JSON_OBJ = $(patsubst $(SCAD_DIR)/%.scad,$(JSON_DIR)/%.json,$(SCAD_SRC))
@@ -27,19 +23,13 @@ POLYFLAGS =
SCADFLAGS =
# Targets
all: stl $(JSON_DIR)/keys.json
all: $(JSON_DIR)/keys.json poly
poly: $(POLY_OBJ)
$(STL_DIR)/%.d: $(SCAD_DIR)/%.scad
bin/parse.py $< $(STL_DIR)/$*.d $(JSON_DIR)/$*.json
$(JSON_DIR)/%.json: $(SCAD_DIR)/%.scad
bin/parse.py $< $(STL_DIR)/$*.d $(JSON_DIR)/$*.json
bin/parse.py $< $@
$(POLY_DIR)/%.gen.scad: $(SVG_DIR)/%.svg
$(POLY) $(POLYFLAGS) --fname $@ $<
$(JSON_DIR)/keys.json: $(JSON_OBJ)
bin/json_merge.py $^ >$(JSON_DIR)/keys.json
clean:
-rm -f $(POLY_DIR)/*.gen.scad $(STL_DIR)/*.stl $(STL_DIR)/*.d $(JSON_DIR)/*.json
include $(patsubst $(SCAD_DIR)/%.scad,$(STL_DIR)/%.d,$(SCAD_SRC))
stl: $(STL_OBJ)
-rm -f $(POLY_DIR)/*.gen.scad $(JSON_DIR)/*.json