summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-12-23 16:33:25 +0100
committerGravatar Christian Hesse <mail@eworm.de>2013-12-23 16:33:25 +0100
commitb8b8d7f7ebca5946723c127ff9bee1eeaa9a94e3 (patch)
treee332864aad47bd4da41008725e414f8035198c54 /Makefile
parent5b73c2ebfed7b3e0742db5ab96dcaa71447faf8c (diff)
downloadnullshell-b8b8d7f7ebca5946723c127ff9bee1eeaa9a94e3.tar.gz
nullshell-b8b8d7f7ebca5946723c127ff9bee1eeaa9a94e3.tar.zst
introduce config.h and add some fuzzy output text
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
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