summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-03-07 12:21:34 +0100
committerMichael Schwarz <michi.schwarz@gmail.com>2015-03-07 12:24:57 +0100
commit36c43557352828b7b9738f8114c493c5fd6a5e9a (patch)
treeb71e8467467f2a86e1d10f859102b4b3fa0002df /Makefile
parent09b8f8c1268c9b8c872ec39a09795ecbcac9d00c (diff)
downloadpogojig-36c43557352828b7b9738f8114c493c5fd6a5e9a.tar.gz
pogojig-36c43557352828b7b9738f8114c493c5fd6a5e9a.tar.bz2
pogojig-36c43557352828b7b9738f8114c493c5fd6a5e9a.zip
Re-compile on makefile change.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 79deb61..a4b7a7e 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,9 @@ DEPENDENCY_FILES := $(patsubst %.scad,%.d,$(COMPILED_SCAD_FILES))
STL_FILES := $(patsubst %.scad,%.stl,$(COMPILED_SCAD_FILES))
DXF_FILES := $(patsubst %.svg,%.dxf,$(SVG_FILES))
+# Dependencies which may affect the result of all build products.
+GLOBAL_DEPS := Makefile config.mk settings.mk
+
# Everything. Also generates files which aren't compiled to anything else.
all: $(GENERATED_FILES) $(DXF_FILES) $(STL_FILES)
@@ -44,13 +47,13 @@ clean:
-include config.mk settings.mk $(DEPENDENCY_FILES)
# Rule to convert an SVG file to a DXF file.
-%.dxf: %.svg
+%.dxf: %.svg $(GLOBAL_DEPS)
$(PYTHON_CMD) -m dxf_export $< $@
# Rule to compile an OpenSCAD file to an STL file. We require all DXF files to exist before an OpenSCAD file can be used to generate an STL file. Additional dependencies are read from the included makefiles generated during compiling.
-%.stl: %.scad | $(DXF_FILES)
+%.stl: %.scad $(GLOBAL_DEPS) | $(DXF_FILES)
$(PYTHON_CMD) -m openscad $< $@ $*.d
-# Rule for automaticlaly generated OpenSCAD files.
-$(GENERATED_FILES): generate_sources.sh
+# Rule for automaticaly generated OpenSCAD files.
+$(GENERATED_FILES): generate_sources.sh $(GLOBAL_DEPS)
./generate_sources.sh $@