diff options
author | jaseg <git@jaseg.de> | 2021-02-04 22:53:33 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2021-02-04 22:53:33 +0100 |
commit | fb9c6ac32ce578c04af8d241528c65a755e14216 (patch) | |
tree | 62b009038093ffac7e5de14796cc241ea36021ff | |
parent | bdd79a8f2b76faaef7097124a4f4815f8cefd164 (diff) | |
download | gerbolyze-fb9c6ac32ce578c04af8d241528c65a755e14216.tar.gz gerbolyze-fb9c6ac32ce578c04af8d241528c65a755e14216.tar.bz2 gerbolyze-fb9c6ac32ce578c04af8d241528c65a755e14216.zip |
svg-flatten: Add dependency check
-rw-r--r-- | svg-flatten/Makefile | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/svg-flatten/Makefile b/svg-flatten/Makefile index 00a17dd..bb35aed 100644 --- a/svg-flatten/Makefile +++ b/svg-flatten/Makefile @@ -1,9 +1,11 @@ CXX := clang++ LD := ld +INSTALL := install PKG_CONFIG ?= pkg-config BUILDDIR ?= build +PREFIX ?= /usr/local UPSTREAM_DIR ?= ../upstream SOURCES := src/svg_color.cpp \ @@ -35,16 +37,22 @@ SUBPROCESS_INCLUDES ?= -I$(UPSTREAM_DIR)/subprocess.h SOURCES += $(CLIPPER_SOURCES) INCLUDES := -Iinclude -Isrc $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES) $(ARGAGG_INCLUDES) $(CAVC_INCLUDES) $(SUBPROCESS_INCLUDES) +PKG_CONFIG_DEPS := pangocairo pugixml opencv4 CXXFLAGS := -std=c++2a -g -Wall -Wextra -O0 -CXXFLAGS += $(shell $(PKG_CONFIG) --cflags pangocairo pugixml opencv4) +CXXFLAGS += $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_DEPS)) LDFLAGS := -lm -lc -lstdc++ -LDFLAGS += $(shell $(PKG_CONFIG) --libs pangocairo pugixml opencv4) +LDFLAGS += $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_DEPS)) TARGET := svg-flatten all: $(BUILDDIR)/$(TARGET) +.PHONY: check-deps +check-deps: + @echo + @$(PKG_CONFIG) --cflags --libs $(PKG_CONFIG_DEPS) >/dev/null + $(BUILDDIR)/%.o: %.cpp @mkdir -p $(dir $@) $(CXX) -c $(CXXFLAGS) $(CXXFLAGS) $(INCLUDES) -o $@ $^ @@ -52,6 +60,10 @@ $(BUILDDIR)/%.o: %.cpp $(BUILDDIR)/$(TARGET): $(SOURCES:%.cpp=$(BUILDDIR)/%.o) @mkdir -p $(dir $@) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ + +.PHONY: install +install: + $(INSTALL) $(BUILDDIR)/$(TARGET) $(PREFIX)/bin .PHONY: clean clean: |