diff --git a/.gitignore b/.gitignore index 46e6163..c1b78b3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ *.img dc-build.sh .buildconfig +GL/version.h diff --git a/GL/flush.c b/GL/flush.c index 6c68fe7..408c680 100644 --- a/GL/flush.c +++ b/GL/flush.c @@ -6,6 +6,7 @@ #include "../containers/aligned_vector.h" #include "private.h" #include "profiler.h" +#include "version.h" #define TA_SQ_ADDR (unsigned int *)(void *) \ (0xe0000000 | (((unsigned long)0x10000000) & 0x03ffffe0)) @@ -87,6 +88,8 @@ void APIENTRY glKosInitConfig(GLdcConfig* config) { void APIENTRY glKosInitEx(GLdcConfig* config) { TRACE(); + printf("\nWelcome to GLdc! Git revision: %s\n\n", GLDC_VERSION); + _glInitPVR(config->autosort_enabled); _glInitMatrices(); diff --git a/Makefile b/Makefile index 76a1114..f761d3a 100644 --- a/Makefile +++ b/Makefile @@ -6,17 +6,20 @@ # Copyright (C) 2018 Luke Benstead TARGET = libGLdc.a -OBJS = GL/draw.o GL/flush.o GL/framebuffer.o GL/immediate.o GL/lighting.o GL/state.o GL/texture.o GL/glu.o +OBJS = GL/draw.o GL/flush.o GL/framebuffer.o GL/immediate.o GL/lighting.o GL/state.o GL/texture.o GL/glu.o GL/version.h OBJS += GL/matrix.o GL/fog.o GL/error.o GL/clip.o containers/stack.o containers/named_array.o containers/aligned_vector.o GL/profiler.o SUBDIRS = KOS_CFLAGS += -ffast-math -Ofast -Iinclude +GL/version.h: + @echo -e '#pragma once\n#define GLDC_VERSION "$(shell git describe --abbrev=4 --dirty --always --tags)"\n' > $@ + link: $(KOS_AR) rcs $(TARGET) $(OBJS) -build: $(OBJS) link +build: GL/version.h $(OBJS) link samples: build