blob: 520100b90ad70a665b2843d406ab5e0aeabba176 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
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 \
src/main.cpp \
src/out_svg.cpp \
src/out_gerber.cpp \
src/out_sexp.cpp \
src/out_flattener.cpp \
src/lambda_sink.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
ARGAGG_INCLUDES ?= -Iupstream/argagg/include/argagg
CAVC_INCLUDES ?= -Iupstream/CavalierContours/include/cavc/
SUBPROCESS_INCLUDES ?= -Iupstream/subprocess.h
SOURCES += $(CLIPPER_SOURCES)
INCLUDES := -Iinclude -Isrc $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES) $(ARGAGG_INCLUDES) $(CAVC_INCLUDES) $(SUBPROCESS_INCLUDES)
CXXFLAGS := -std=c++2a -g -Wall -Wextra -O0
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags pangocairo pugixml opencv4)
LDFLAGS := -lm -lc -lstdc++
LDFLAGS += $(shell $(PKG_CONFIG) --libs pangocairo pugixml opencv4)
TARGET := svg-render
all: $(BUILDDIR)/$(TARGET)
test.gbr test.svg &: render
./render test.svg > test.gbr
$(BUILDDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(CXXFLAGS) $(CXXFLAGS) $(INCLUDES) -o $@ $^
$(BUILDDIR)/$(TARGET): $(SOURCES:%.cpp=$(BUILDDIR)/%.o) $(BUILDDIR)/upstream/cpp-base64/base64.o
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
.PHONY: clean
clean:
rm -rf $(BUILDDIR)
|