*.so
*.tar.gz
sandbox
+version.h
+version = 3.3.0
include config.mk
-all: src.subdir-all
+all: version.h src.subdir-all
+
+version.h: Makefile .git/index
+ @echo "create $@"
+ $(Q)v="$$(git describe --tags 2>/dev/null)"; \
+ echo "#define VERSION \"$${v:-$(version)}\"" > $@
options:
@echo "vimb build options:"
@echo "EXTCFLAGS = $(EXTCFLAGS)"
@echo "CC = $(CC)"
-install: src.subdir-all
+install: all
@# binary
install -d $(BINPREFIX)
install -m 755 src/vimb $(BINPREFIX)/vimb
install -m 644 src/webextension/$(EXTTARGET) $(LIBDIR)/$(EXTTARGET)
@# man page
install -d $(MANPREFIX)/man1
- @sed -e "s!VERSION!$(VERSION)!g" \
+ @sed -e "s!VERSION!$(version)!g" \
-e "s!PREFIX!$(PREFIX)!g" \
-e "s!DATE!`date +'%m %Y'`!g" $(DOCDIR)/vimb.1 > $(MANPREFIX)/man1/vimb.1
@# .desktop file
-VERSION = 3.3.0
-
ifneq ($(V),1)
Q := @
endif
# used libs
LIBS = gtk+-3.0 'webkit2gtk-4.0 >= 2.20.0'
-COMMIT := $(shell git describe --tags --always 2> /dev/null || echo "unknown")
-
# setup general used CFLAGS
CFLAGS += -std=c99 -pipe -Wall -fPIC
-CPPFLAGS += -DVERSION=\"${VERSION}\" -DEXTENSIONDIR=\"${EXTENSIONDIR}\" -DCOMMIT=\"$(COMMIT)\"
+CPPFLAGS += -DEXTENSIONDIR=\"${EXTENSIONDIR}\"
CPPFLAGS += -DPROJECT=\"vimb\" -DPROJECT_UCFIRST=\"Vimb\"
CPPFLAGS += -D_XOPEN_SOURCE=500
CPPFLAGS += -D__BSD_VISIBLE
#include <unistd.h>
#include <webkit2/webkit2.h>
+#include "../version.h"
#include "ascii.h"
#include "command.h"
#include "completion.h"
}
if (ver) {
- printf("%s, version %s\n\n", PROJECT, VERSION);
+ printf("%s, version %s\n", PROJECT, VERSION);
return EXIT_SUCCESS;
}
if (buginfo) {
- printf("Commit: %s\n", COMMIT);
+ printf("Version: %s\n", VERSION);
printf("WebKit compile: %d.%d.%d\n",
WEBKIT_MAJOR_VERSION,
WEBKIT_MINOR_VERSION,
#include <glib.h>
#include <string.h>
+#include "../version.h"
#include "completion.h"
#include "config.h"
#include "ext-proxy.h"