diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | bfs.h | 9 |
2 files changed, 14 insertions, 3 deletions
@@ -9,13 +9,19 @@ # the COPYING file or http://www.wtfpl.net/ for more details. # ##################################################################### +ifeq ($(wildcard .git),) +VERSION := 0.67 +else +VERSION := $(shell git describe --always) +endif + CC ?= gcc CFLAGS ?= -g -Wall LDFLAGS ?= DEPFLAGS ?= -MD -MP -MF $(@:.o=.d) RM ?= rm -f -LOCAL_CPPFLAGS := -D_DEFAULT_SOURCE -D_GNU_SOURCE +LOCAL_CPPFLAGS := -D_DEFAULT_SOURCE -D_GNU_SOURCE -DBFS_VERSION=\"$(VERSION)\" LOCAL_CFLAGS := -std=c99 ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS) @@ -18,8 +18,13 @@ #include <sys/types.h> #include <time.h> -#define BFS_VERSION "0.0" -#define BFS_HOMEPAGE "https://github.com/tavianator/bfs" +#ifndef BFS_VERSION +# define BFS_VERSION "0.67" +#endif + +#ifndef BFS_HOMEPAGE +# define BFS_HOMEPAGE "https://github.com/tavianator/bfs" +#endif /** * A command line expression. |