Skip to content

Commit

Permalink
Export _LIBOGC2_REVISION_
Browse files Browse the repository at this point in the history
Use local commit date as build date
  • Loading branch information
Extrems committed Jan 2, 2025
1 parent b29feb6 commit f39a23e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ cube: gc/ogc/libversion.h


#---------------------------------------------------------------------------------
gc/ogc/libversion.h : Makefile
gc/ogc/libversion.h: .git/HEAD .git/index Makefile
#---------------------------------------------------------------------------------
@echo "#ifndef __OGC_LIBVERSION_H__" > $@
@echo "#define __OGC_LIBVERSION_H__" >> $@
Expand All @@ -211,10 +211,12 @@ gc/ogc/libversion.h : Makefile
@echo "#define _V_MINOR_ $(LIBOGC_MINOR)" >> $@
@echo "#define _V_PATCH_ $(LIBOGC_PATCH)" >> $@
@echo >> $@
@echo "#define _V_DATE_ __DATE__" >> $@
@echo "#define _V_TIME_ __TIME__" >> $@
@echo "#define _V_DATE_ $$(git log -1 --format=%cd --date=format-local:'"%b %e %Y"')" >> $@
@echo "#define _V_TIME_ $$(git log -1 --format=%cd --date=format-local:'"%H:%M:%S"')" >> $@
@echo >> $@
@echo '#define _V_STRING "libOGC Release '$(LIBOGC_MAJOR).$(LIBOGC_MINOR).$(LIBOGC_PATCH)'"' >> $@
@echo '#define _V_STRING "libogc2 '$(VERSTRING)'"' >> $@
@echo >> $@
@echo "#define _LIBOGC2_REVISION_ $$(git rev-list --count HEAD)" >> $@
@echo >> $@
@echo "#endif // __OGC_LIBVERSION_H__" >> $@

Expand Down

0 comments on commit f39a23e

Please sign in to comment.