summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7bc7774..c31e565 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,13 @@ CFLAGS = -Wall -g -std=c++11 -Werror=missing-prototypes
LDFLAGS =
OUTPUT = Engine
BUILDDIR = build
+#VERSION
+VERSION = 0
+PATCHLEVEL = 1
OBJ = main.o cObject.o cObjectHandler.o cRender.o cInput.o
-debug: $(OBJ)
+debug: genversion $(OBJ)
mkdir -p $(BUILDDIR)
$(CC) $(CFLAGS) -o $(BUILDDIR)/$(OUTPUT) $(OBJ) $(LDFLAGS)
@@ -22,7 +25,16 @@ all: clean debug
.PHONY: clean
clean:
- rm -df $(BUILDDIR)/$(OUTPUT) *.o
+ rm -df $(BUILDDIR)/$(OUTPUT) *.o version.h
run: debug
./$(BUILDDIR)/$(OUTPUT)
+
+genversion:
+ @echo Building Version
+ @echo "//Generated my MAKEFILE. DO NOT Edit." > version.h
+ @echo "#pragma once" >> version.h
+ @echo "#define VERSION $(VERSION)" >> version.h
+ @echo "#define PATCHLEVEL $(PATCHLEVEL)" >> version.h
+ @echo "#define DATE \"`date +'%d.%m.20%y'`\"" >> version.h
+ @echo "#define TIME \"`date +'%H:%M:%S'`\"" >> version.h