mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-07 03:39:00 +02:00
* use git describe to create a revision.inc if a .git dir is found
This commit is contained in:
parent
07dcd22b1c
commit
0ff3f04700
@ -558,6 +558,7 @@ endif
|
|||||||
NOCPUDEF=1
|
NOCPUDEF=1
|
||||||
MSGFILE=msg/error$(FPCLANG).msg
|
MSGFILE=msg/error$(FPCLANG).msg
|
||||||
SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
|
SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
|
||||||
|
GIT:=$(firstword $(wildcard $(addsuffix /git$(SRCEXEEXT),$(SEARCHPATH))))
|
||||||
PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
|
PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
|
||||||
ifndef PPUDUMP
|
ifndef PPUDUMP
|
||||||
ifdef PPUDUMPPROG
|
ifdef PPUDUMPPROG
|
||||||
@ -570,6 +571,15 @@ REVINC:=$(wildcard revision.inc)
|
|||||||
ifneq ($(REVINC),)
|
ifneq ($(REVINC),)
|
||||||
override LOCALOPT+=-dREVINC
|
override LOCALOPT+=-dREVINC
|
||||||
ifeq ($(REVSTR),)
|
ifeq ($(REVSTR),)
|
||||||
|
ifneq ($(wildcard ../.git),)
|
||||||
|
ifneq ($(GIT),)
|
||||||
|
GITDESCRIBE=$(shell $(GIT) describe --dirty)
|
||||||
|
REVSTR:=$(word 2,$(subst -, ,$(GITDESCRIBE)))-$(word 3,$(subst -, ,$(GITDESCRIBE)))
|
||||||
|
ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
|
||||||
|
REVSTR:=$(REVSTR)-$(word 4,$(subst -, ,$(GITDESCRIBE)))
|
||||||
|
endif
|
||||||
|
export REVSTR
|
||||||
|
else
|
||||||
ifneq ($(SVNVERSION),)
|
ifneq ($(SVNVERSION),)
|
||||||
REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
|
REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
|
||||||
export REVSTR
|
export REVSTR
|
||||||
@ -581,6 +591,8 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
override LOCALOPT+=-d$(CPC_TARGET) -dGDB
|
override LOCALOPT+=-d$(CPC_TARGET) -dGDB
|
||||||
ifdef LLVM
|
ifdef LLVM
|
||||||
ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)
|
ifeq ($(findstring $(PPC_TARGET),x86_64 aarch64 arm),)
|
||||||
|
@ -292,6 +292,7 @@ MSGFILE=msg/error$(FPCLANG).msg
|
|||||||
|
|
||||||
|
|
||||||
SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
|
SVNVERSION:=$(firstword $(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))))
|
||||||
|
GIT:=$(firstword $(wildcard $(addsuffix /git$(SRCEXEEXT),$(SEARCHPATH))))
|
||||||
PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
|
PPUDUMPPROG:=$(firstword $(strip $(wildcard $(addsuffix /ppudump$(SRCEXEEXT),$(SEARCHPATH)))))
|
||||||
ifndef PPUDUMP
|
ifndef PPUDUMP
|
||||||
ifdef PPUDUMPPROG
|
ifdef PPUDUMPPROG
|
||||||
@ -310,6 +311,15 @@ override LOCALOPT+=-dREVINC
|
|||||||
# Automatically update revision.inc if
|
# Automatically update revision.inc if
|
||||||
# svnversion executable is available
|
# svnversion executable is available
|
||||||
ifeq ($(REVSTR),)
|
ifeq ($(REVSTR),)
|
||||||
|
ifneq ($(wildcard ../.git),)
|
||||||
|
ifneq ($(GIT),)
|
||||||
|
GITDESCRIBE=$(shell $(GIT) describe --dirty)
|
||||||
|
REVSTR:=$(word 2,$(subst -, ,$(GITDESCRIBE)))-$(word 3,$(subst -, ,$(GITDESCRIBE)))
|
||||||
|
ifneq ($(word 4,$(subst -, ,$(GITDESCRIBE))),)
|
||||||
|
REVSTR:=$(REVSTR)-$(word 4,$(subst -, ,$(GITDESCRIBE)))
|
||||||
|
endif
|
||||||
|
export REVSTR
|
||||||
|
else
|
||||||
ifneq ($(SVNVERSION),)
|
ifneq ($(SVNVERSION),)
|
||||||
REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
|
REVSTR:=$(subst r,,$(subst r1:,,r$(subst exported,,$(shell $(SVNVERSION) -c .))))
|
||||||
export REVSTR
|
export REVSTR
|
||||||
@ -321,6 +331,8 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
|
# set correct defines (-d$(CPU_TARGET) is automatically added in makefile.fpc)
|
||||||
override LOCALOPT+=-d$(CPC_TARGET) -dGDB
|
override LOCALOPT+=-d$(CPC_TARGET) -dGDB
|
||||||
|
Loading…
Reference in New Issue
Block a user