diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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 |