Commit 1122e56f authored by Sebastian Ramacher's avatar Sebastian Ramacher

Copy version checks from zathura

Signed-off-by: default avatarSebastian Ramacher <sebastian@ramacher.at>
parent af282aa3
......@@ -14,3 +14,4 @@ version.h
gcov/
*.swp
doc/
.version-checks/
......@@ -22,6 +22,16 @@ endif
all: options ${PROJECT} po
# pkg-config based version checks
.version-checks/%:
$(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \
pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
echo "The minium required version of $(*) is $($(*)_MIN_VERSION)" && \
false \
)
@mkdir -p .version-checks
$(QUIET)touch $@
options:
@echo ${PROJECT} build options:
@echo "CFLAGS = ${CFLAGS}"
......@@ -44,8 +54,7 @@ version.h: version.h.in config.mk
$(ECHO) CC $<
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
${OBJECTS}: config.mk version.h
${DOBJECTS}: config.mk version.h
${OBJECTS} ${DOBJECTS}: config.mk version.h .version-checks/GTK
${PROJECT}: static shared
static: lib${PROJECT}.a
......@@ -63,7 +72,8 @@ clean:
$(QUIET)rm -rf ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
${DOBJECTS} lib${PROJECT}.a lib${PROJECT}-debug.a ${PROJECT}.pc doc \
lib$(PROJECT).so.${SOVERSION} lib${PROJECT}-debug.so.${SOVERSION} .depend \
${PROJECTNV}-${VERSION}.tar.gz version.h *gcda *gcno $(PROJECT).info gcov
${PROJECTNV}-${VERSION}.tar.gz version.h *gcda *gcno $(PROJECT).info gcov \
.version-checks
$(QUIET)${MAKE} -C tests clean
$(QUIET)${MAKE} -C po clean
......
......@@ -24,8 +24,17 @@ INCLUDEDIR ?= ${PREFIX}/include
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
# the GTK+ version to use
GIRARA_GTK_VERSION ?= 3
# version checks
# If you want to disable any of the checks, set *_VERSION_CHECK to 0.
# GTK+
GTK_VERSION_CHECK ?= 1
GTK_MIN_VERSION = 3.2
GTK_PKG_CONFIG_NAME = gtk+-$(GIRARA_GTK_VERSION).0
# libs
GTK_INC ?= $(shell pkg-config --cflags gtk+-${GIRARA_GTK_VERSION}.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-${GIRARA_GTK_VERSION}.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment