mirror of
https://github.com/janet-lang/janet
synced 2024-12-25 07:50:27 +00:00
Add git commit hash to build to get version.
This commit is contained in:
parent
5625023925
commit
853a839f6c
4
Makefile
4
Makefile
@ -27,9 +27,11 @@ PREFIX?=/usr/local
|
||||
INCLUDEDIR=$(PREFIX)/include/janet
|
||||
LIBDIR=$(PREFIX)/lib
|
||||
BINDIR=$(PREFIX)/bin
|
||||
JANET_VERSION?="\"commit-$(shell git log --pretty=format:'%h' -n 1)\""
|
||||
|
||||
#CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -g
|
||||
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden
|
||||
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -fvisibility=hidden \
|
||||
-DJANET_VERSION=$(JANET_VERSION)
|
||||
CLIBS=-lm -ldl
|
||||
JANET_TARGET=janet
|
||||
JANET_LIBRARY=libjanet.so
|
||||
|
@ -29,7 +29,9 @@ extern "C" {
|
||||
|
||||
/***** START SECTION CONFIG *****/
|
||||
|
||||
#ifndef JANET_VERSION
|
||||
#define JANET_VERSION "0.0.0 alpha"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Detect OS and endianess.
|
||||
|
@ -249,7 +249,7 @@ static void historymove(int delta) {
|
||||
historyi = history_count - 1;
|
||||
return;
|
||||
}
|
||||
strncpy(buf, history[historyi], JANET_LINE_MAX);
|
||||
strncpy(buf, history[historyi], JANET_LINE_MAX - 1);
|
||||
pos = len = strlen(buf);
|
||||
buf[len] = '\0';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user