aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-05-07 16:49:47 +0100
committerFreeArtMan <dos21h@gmail.com>2017-05-07 16:49:47 +0100
commit910c1942b21bd88fa9b2091a0f7322f6b2c96df7 (patch)
tree7b2569f9c72648e037fd1663075fd6b4df0e4565 /Makefile
parent77b33a254d698fb65f83fe3df0e0e7410a2c78d6 (diff)
downloadagni-910c1942b21bd88fa9b2091a0f7322f6b2c96df7.tar.gz
agni-910c1942b21bd88fa9b2091a0f7322f6b2c96df7.zip
Forgot add Makefile changes
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d628236..6fbc0fc 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ PROJECT=agni
CC=gcc
CFLAGS=
-make:
+make: version
$(CC) $(CFLAGS) buf.c -c
$(CC) $(CFLAGS) mmm.c -c
$(CC) $(CFLAGS) darray.c -c
@@ -27,6 +27,15 @@ make:
cmd_rusage.c cmd_cmd.o sha1.o cmd_sha1.o agni.c \
-o $(PROJECT) -std=c11 -lrt
+version:
+ #could have bug if commit message have somethign bad in it
+ rm -f version.h
+ echo "#ifndef __VERSION_H">>version.h
+ echo "#define __VERSION_H">>version.h
+ echo "#define VERSION_DATE \""`date`"\"">>version.h
+ echo "#define VERSION_COMMIT \""`git log -1 --oneline`"\"">>version.h
+ echo "#endif">>version.h
+
leak:
valgrind --leak-check=full --track-origins=yes --log-file=log.txt ./$(PROJECT)