mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
Replaced date with Git hash.
This commit is contained in:
parent
01a96ece85
commit
22c63e743a
@ -5,7 +5,7 @@
|
||||
GH_PAGES = ../gh-pages
|
||||
|
||||
all:
|
||||
date +%F | zip -z cc65
|
||||
echo $(TRAVIS_COMMIT) | zip -z cc65
|
||||
ifdef GH_TOKEN
|
||||
git clone --branch=gh-pages https://$(GH_TOKEN)@github.com/cc65/cc65.git $(GH_PAGES)
|
||||
cd $(GH_PAGES) && git config user.name "Oliver Schmidt"
|
||||
|
10
src/Makefile
10
src/Makefile
@ -39,9 +39,17 @@ ifdef USER_CFLAGS
|
||||
$(info USER_CFLAGS: $(USER_CFLAGS))
|
||||
endif
|
||||
|
||||
ifndef GIT_SHA
|
||||
GIT_SHA := $(if $(wildcard ../.git),$(shell git rev-parse --short HEAD))
|
||||
ifneq ($(words $(GIT_SHA)),1)
|
||||
GIT_SHA := N/A
|
||||
endif
|
||||
endif
|
||||
$(info GIT_SHA: $(GIT_SHA))
|
||||
|
||||
CFLAGS += -MMD -MP -O -I common \
|
||||
-Wall -Wextra -Wno-char-subscripts $(USER_CFLAGS) \
|
||||
-DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
|
||||
-DGIT_SHA=$(GIT_SHA) -DCA65_INC=$(CA65_INC) -DCC65_INC=$(CC65_INC) \
|
||||
-DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG)
|
||||
|
||||
LDLIBS += -lm
|
||||
|
@ -33,8 +33,10 @@
|
||||
|
||||
|
||||
|
||||
#include "version.h"
|
||||
/* common */
|
||||
#include "xsprintf.h"
|
||||
#include "searchpath.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
|
||||
@ -58,8 +60,12 @@
|
||||
const char* GetVersionAsString (void)
|
||||
/* Returns the version number as a string in a static buffer */
|
||||
{
|
||||
static char Buf[40];
|
||||
xsnprintf (Buf, sizeof (Buf), "%u.%u - %s", VER_MAJOR, VER_MINOR, __DATE__);
|
||||
static char Buf[60];
|
||||
#if defined(GIT_SHA)
|
||||
xsnprintf (Buf, sizeof (Buf), "%u.%u - Git %s", VER_MAJOR, VER_MINOR, STRINGIZE (GIT_SHA));
|
||||
#else
|
||||
xsnprintf (Buf, sizeof (Buf), "%u.%u", VER_MAJOR, VER_MINOR);
|
||||
#endif
|
||||
return Buf;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user