aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-01-24 18:44:56 +0100
committerjaseg <git@jaseg.de>2021-01-24 18:44:56 +0100
commitf7b4cc602b9a646fbc66f3f17d6bb9c20efc3ead (patch)
treed7b110b65e93b87fc65472559ac74e7eb961bc7c /Makefile
downloadgerbolyze-f7b4cc602b9a646fbc66f3f17d6bb9c20efc3ead.tar.gz
gerbolyze-f7b4cc602b9a646fbc66f3f17d6bb9c20efc3ead.tar.bz2
gerbolyze-f7b4cc602b9a646fbc66f3f17d6bb9c20efc3ead.zip
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..062c50e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+
+CXX := clang
+LD := ld
+PKG_CONFIG ?= pkg-config
+
+BUILDDIR ?= build
+
+SOURCES := src/svg_color.cpp \
+ src/svg_doc.cpp \
+ src/svg_geom.cpp \
+ src/svg_import_util.cpp \
+ src/svg_path.cpp \
+ src/svg_pattern.cpp \
+ src/vec_core.cpp \
+ src/vec_grid.cpp
+
+CLIPPER_SOURCES := upstream/clipper-6.4.2/cpp/clipper.cpp upstream/clipper-6.4.2/cpp/cpp_cairo/cairo_clipper.cpp
+CLIPPER_INCLUDES := -Iupstream/clipper-6.4.2/cpp -Iupstream/clipper-6.4.2/cpp/cpp_cairo/
+VORONOI_INCLUDES := -Iupstream/voronoi/src
+POISSON_INCLUDES := -Iupstream/poisson-disk-sampling/thinks/poisson_disk_sampling/
+BASE64_INCLUDES := -Iupstream/cpp-base64
+INCLUDES := $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES)
+
+CXXFLAGS := -std=c++2a -g -Wall -Wextra
+CXXFLAGS += $(shell $(PKG_CONFIG) --cflags pangocairo pugixml opencv4)
+
+LDFLAGS := -lm -lc -lstdc++
+LDFLAGS += $(shell $(PKG_CONFIG) --libs pangocairo pugixml opencv4)
+
+all: $(BUILDDIR)/svg-render
+
+test.gbr test.svg &: render
+ ./render test.svg > test.gbr
+
+$(BUILDDIR)/%.o: %.cpp
+ @mkdir -p $(dir $@)
+ $(CXX) -c $(CXXFLAGS) $(CXXFLAGS) $(INCLUDES) -o $@ $^
+
+$(BUILDDIR)/svg-render: $(SOURCES:%.cpp=$(BUILDDIR)/%.o) $(BUILDDIR)/upstream/cpp-base64/base64.o $(CLIPPER_SOURCES:.cpp=.o)
+ @mkdir -p $(dir $@)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
+
+.PHONY: clean
+clean:
+ rm -rf $(BUILDDIR)