]> git.lizzy.rs Git - bspwm.git/commitdiff
Introduce VERCMD in Makefile
authorBastien Dejean <nihilhill@gmail.com>
Wed, 16 Mar 2016 09:13:45 +0000 (10:13 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Wed, 16 Mar 2016 09:13:45 +0000 (10:13 +0100)
This is useful when the author has to make a release commit, in which
case `make doc` is required, but, because the tag doesn't exist yet, the
output of VERCMD won't be what we want. Therefore, we need to override
VERCMD for the *doc* target: `make VERCMD=false doc`.

Makefile

index 841518cddc0533a07f6a9e67db4bd8755db75b42..331408f463d0d6c3306631973f2df7a8468e65ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
-VERSION := $(shell git describe 2> /dev/null || cat VERSION)
+VERCMD  ?= git describe 2> /dev/null
+VERSION := $(shell $(VERCMD) || cat VERSION)
 
 CPPFLAGS += -D_POSIX_C_SOURCE=200112L -DVERSION=\"$(VERSION)\"
 CFLAGS   += -std=c99 -pedantic -Wall -Wextra
@@ -11,14 +12,14 @@ DOCPREFIX ?= $(PREFIX)/share/doc/bspwm
 BASHCPL   ?= $(PREFIX)/share/bash-completion/completions
 ZSHCPL    ?= $(PREFIX)/share/zsh/site-functions
 
-MD_DOCS = README.md doc/CHANGELOG.md doc/CONTRIBUTING.md doc/INSTALL.md doc/MISC.md doc/TODO.md
+MD_DOCS    = README.md doc/CHANGELOG.md doc/CONTRIBUTING.md doc/INSTALL.md doc/MISC.md doc/TODO.md
 XSESSIONS ?= $(PREFIX)/share/xsessions
 
-WM_SRC = bspwm.c helpers.c geometry.c jsmn.c settings.c monitor.c desktop.c tree.c stack.c history.c \
+WM_SRC   = bspwm.c helpers.c geometry.c jsmn.c settings.c monitor.c desktop.c tree.c stack.c history.c \
         events.c pointer.c window.c messages.c parse.c query.c restore.c rule.c ewmh.c subscribe.c
-WM_OBJ = $(WM_SRC:.c=.o)
-CLI_SRC = bspc.c helpers.c
-CLI_OBJ = $(CLI_SRC:.c=.o)
+WM_OBJ  := $(WM_SRC:.c=.o)
+CLI_SRC  = bspc.c helpers.c
+CLI_OBJ := $(CLI_SRC:.c=.o)
 
 all: bspwm bspc