From b8b8d7f7ebca5946723c127ff9bee1eeaa9a94e3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 23 Dec 2013 16:33:25 +0100 Subject: introduce config.h and add some fuzzy output text --- Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8071077..9b0c01a 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,27 @@ # nullshell - do nothing but print asterisks, can be used for login shell PREFIX := /usr +CP := cp CC := gcc MD := markdown INSTALL := install RM := rm CFLAGS += -O2 -Wall -Werror +VERSION := $(shell git describe --tags --long 2>/dev/null) +# this is just a fallback in case you do not use git but downloaded +# a release tarball... +ifeq ($(VERSION),) +VERSION := 0.0.1 +endif all: nullshell README.html -nullshell: nullshell.c - $(CC) $(CFLAGS) $(LDFLAGS) nullshell.c -o nullshell +nullshell: nullshell.c config.h + $(CC) $(CFLAGS) $(LDFLAGS) nullshell.c -o nullshell \ + -DVERSION="\"$(VERSION)\"" + +config.h: + $(CP) config.def.h config.h README.html: README.md $(MD) README.md > README.html -- cgit v1.2.3-70-g09d2