summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-09-10 23:04:44 +0200
committerMichael Schwarz <michi.schwarz@gmail.com>2015-09-16 01:41:46 +0200
commit4a1b8166e1263eadff3ae0580ba3780dfd0a0e86 (patch)
tree3ce441549e17f320d2dc977e99fad640c1dd92bf /Makefile
parenta6b45d8e86c934ee09f338a3b8ab08ce2dd95255 (diff)
downloadpogojig-4a1b8166e1263eadff3ae0580ba3780dfd0a0e86.tar.gz
pogojig-4a1b8166e1263eadff3ae0580ba3780dfd0a0e86.tar.bz2
pogojig-4a1b8166e1263eadff3ae0580ba3780dfd0a0e86.zip
Only print abstract information about commands being executed.
Most commands only show the python wrapper being called, which does not tell the user much anyways.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 19 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 854e2d2..1a786c4 100644
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,9 @@ ASYMPTOTE_EXPORTED_SVG_FILES :=
# Remove targets whose command failed.
.DELETE_ON_ERROR:
-# Goal to build Everything. Also generates files which aren't compiled to anything else. Deined here to make it the default goal.
-all: generated dxf stl asy pdf
+.SILENT:
+
+.DEFAULT_GOAL := all
# Include the configuration files.
-include config.mk settings.mk
@@ -31,11 +32,13 @@ ASYMPTOTE_CMD := ASYMPTOTE=$(ASYMPTOTE) $(PYTHON_CMD) -m asymptote
# Takes a list of file names and returns all elements whose basename do not start with a `_' and which have extension ext. The returned names will have their extension replaced by subst_ext.
filter_compiled = $(foreach i,$(patsubst %$1,%$2,$(filter %$1,$3)),$(if $(filter-out _%,$(notdir $i)),$i))
+EXISTING_FILES := $(shell find src -not \( \( -name '.*' -or -name '* *' \) -prune \) -type f)
+
# Run generate_scad.sh to get the names of all files that should be generated using that same script.
GENERATED_FILES := $(shell ./generate_sources.sh)
# All visible files in the src directory that either exist or can be generated. Ignore files whose names contain spaces.
-SRC_FILES := $(sort $(GENERATED_FILES) $(shell find src -not \( \( -name '.*' -or -name '* *' \) -prune \) -type f))
+SRC_FILES := $(sort $(GENERATED_FILES) $(EXISTING_FILES))
# STL files produced from OpenSCAD files.
SCAD_STL_FILES := $(call filter_compiled,.scad,.stl,$(filter-out $(FLAT_SCAD_FILES),$(SRC_FILES)))
@@ -64,9 +67,15 @@ ASY_DEPS := $(filter %.asy,$(SRC_FILES)) $(SVG_ASY_FILES)
# Dependencies which may affect the result of all build products.
GLOBAL_DEPS := Makefile $(wildcard config.mk settings.mk)
+EXISTING_TARGETS := $(filter $(SVG_DXF_FILES) $(SCAD_DXF_FILES) $(SCAD_STL_FILES) $(SVG_ASY_FILES) $(ASY_PDF_FILES) $(GENERATED_FILES) $(DEPENDENCY_FILES),$(EXISTING_FILES))
+
# Everything^-1.
clean:
- rm -rf $(SVG_DXF_FILES) $(SCAD_DXF_FILES) $(SCAD_STL_FILES) $(SVG_ASY_FILES) $(ASY_PDF_FILES) $(GENERATED_FILES) $(DEPENDENCY_FILES)
+ echo [clean] $(EXISTING_TARGETS)
+ rm -rf $(EXISTING_TARGETS)
+
+# Goal to build Everything. Also generates files which aren't compiled to anything else. Deined here to make it the default goal.
+all: generated dxf stl asy pdf
# Goals to build the project up to a specific step.
generated: $(GENERATED_FILES)
@@ -77,25 +86,31 @@ asy: $(SVG_ASY_FILES)
# Rule to convert an SVG file to a DXF file.
$(SVG_DXF_FILES): %.dxf: %.svg $(GLOBAL_DEPS)
+ echo [inkscape] $@
$(INKSCAPE_CMD) $< $@
$(SVG_ASY_FILES): %.asy: %.svg $(GLOBAL_DEPS)
+ echo [inkscape] $@
$(INKSCAPE_CMD) $< $@
# Rule to compile an OpenSCAD file to a DXF file.
$(SCAD_DXF_FILES): %.dxf: %.scad $(GLOBAL_DEPS) | $(SCAD_ORDER_DEPS)
+ echo [openscad] $@
$(OPENSCAD_CMD) $< $@ $*.d
# Rule to compile an OpenSCAD file to an STL file.
$(SCAD_STL_FILES): %.stl: %.scad $(GLOBAL_DEPS) | $(SCAD_ORDER_DEPS)
+ echo [openscad] $@
$(OPENSCAD_CMD) $< $@ $*.d
# Rule to export an SVG file to an Asymptote file.
$(ASY_PDF_FILES): %.pdf: $(ASY_DEPS) $(GLOBAL_DEPS)
+ echo [asymptote] $@
$(ASYMPTOTE_CMD) $*.asy $@
# Rule for automaticaly generated OpenSCAD files.
$(GENERATED_FILES): generate_sources.sh $(GLOBAL_DEPS)
+ echo [generate] $@
./generate_sources.sh $@
# Include dependency files produced by an earlier build.