mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
use "git describe" to determine the version
This commit is contained in:
parent
3e969125c5
commit
b7665a1547
3 changed files with 7 additions and 7 deletions
|
@ -1,10 +1,12 @@
|
|||
TERM = xterm
|
||||
TOPDIR = $(shell pwd)
|
||||
TOPDIR := $(shell pwd)
|
||||
ARCH = x86
|
||||
NAME = hermit
|
||||
LWIPDIRS = lwip/src/arch lwip/src/api lwip/src/core lwip/src/core/ipv4 lwip/src/netif
|
||||
KERNDIRS = kernel mm libkern arch/$(ARCH)/kernel arch/$(ARCH)/mm $(LWIPDIRS)
|
||||
SUBDIRS = $(KERNDIRS)
|
||||
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags)
|
||||
TODAY := $(shell date +'%Y%m%d')
|
||||
|
||||
# Set your own cross compiler tool chain prefix here
|
||||
CROSSCOMPREFIX =
|
||||
|
@ -41,13 +43,13 @@ QEMUSERIALFLAGS = -device pci-serial,chardev=tS0 \
|
|||
|
||||
INCLUDE = -I$(TOPDIR)/include -I$(TOPDIR)/arch/$(ARCH)/include -I$(TOPDIR)/lwip/src/include -I$(TOPDIR)/lwip/src/include/ipv4
|
||||
# Compiler options for final code
|
||||
CFLAGS = -D_HERMIT -g -m64 -Wall -O2 -mno-red-zone -fstrength-reduce -fomit-frame-pointer -finline-functions -ffreestanding -nostdinc -fno-stack-protector $(INCLUDE)
|
||||
CFLAGS = -DVERSION=\"$(GIT_VERSION)\" -D_HERMIT -g -m64 -Wall -O2 -mno-red-zone -fstrength-reduce -fomit-frame-pointer -finline-functions -ffreestanding -nostdinc -fno-stack-protector $(INCLUDE)
|
||||
# Compiler options for debugging
|
||||
debug debug-eclipse : CFLAGS = -D_HERMIT -g -O0 -m64 -Wall -fno-builtin -DWITH_FRAME_POINTER -nostdinc -mno-red-zone -fno-stack-protector $(INCLUDE)
|
||||
debug debug-eclipse : CFLAGS = -DVERSION=\"$(GIT_VERSION)\" -D_HERMIT -g -O0 -m64 -Wall -fno-builtin -DWITH_FRAME_POINTER -nostdinc -mno-red-zone -fno-stack-protector $(INCLUDE)
|
||||
AR = ar
|
||||
ARFLAGS = rsv
|
||||
RM = rm -rf
|
||||
LDFLAGS = -T link.ld -z max-page-size=4096 --defsym __BUILD_DATE=$(shell date +'%Y%m%d') --defsym __BUILD_TIME=$(shell date +'%H%M%S')
|
||||
LDFLAGS = -T link.ld -z max-page-size=4096 --defsym __BUILD_DATE=$(TODAY)
|
||||
STRIP_DEBUG = --strip-debug
|
||||
KEEP_DEBUG = --only-keep-debug
|
||||
OUTPUT_FORMAT = -O elf32-i386
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define HERMIT_VERSION "0.1"
|
||||
#define MAX_CORES 8
|
||||
#define MAX_TASKS 16
|
||||
#define MAX_FNAME 128
|
||||
|
|
|
@ -58,7 +58,6 @@ extern const void kernel_end;
|
|||
extern const void bss_start;
|
||||
extern const void bss_end;
|
||||
extern char __BUILD_DATE;
|
||||
extern char __BUILD_TIME;
|
||||
|
||||
/* Page frame counters */
|
||||
extern atomic_int32_t total_pages;
|
||||
|
@ -141,7 +140,7 @@ int main(void)
|
|||
|
||||
atomic_int32_inc(&cpu_online);
|
||||
|
||||
kprintf("This is Hermit %s Build %u, %u\n", HERMIT_VERSION, &__BUILD_DATE, &__BUILD_TIME);
|
||||
kprintf("This is Hermit %s, build date %u\n", VERSION, &__BUILD_DATE);
|
||||
kprintf("Kernel starts at %p and ends at %p\n", &kernel_start, &kernel_end);
|
||||
kprintf("Processor frequency: %u MHz\n", get_cpu_frequency());
|
||||
kprintf("Total memory: %lu KiB\n", atomic_int32_read(&total_pages) * PAGE_SIZE / 1024);
|
||||
|
|
Loading…
Add table
Reference in a new issue