3 # SPDX-License-Identifier: GPL-2.0-only
15 if [ -z "$XCOMPILE" ] ||
[ "$1" = "--help" ]; then
16 echo "usage: $0 <xcompile>" >&2
22 LANG
= git log
--no-show-signature -1 --format="format:$1" 2>/dev
/null || \
23 LANG
= git log
-1 --format="format:$1"
26 if [ "${BUILD_TIMELESS}" = "1" ]; then
30 elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
31 GITREV
=$
(get_git_head_data
%h
)
33 DATE
=$
(get_git_head_data
%ct
)
37 DATE
=$
(LANG
= LC_ALL
=C TZ
=UTC0
date +%s
)
42 NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin
)
50 IASL
=util
/crossgcc
/xgcc
/bin
/iasl
51 eval $
(grep ^IASL
:= "$XCOMPILE" 2>/dev
/null |
sed s
,:=,=,)
53 #Print out the information that goes into build.h
54 printf "/* build system definitions (autogenerated) */\n"
55 printf "#ifndef __BUILD_H\n"
56 printf "#define __BUILD_H\n\n"
57 printf "#define COREBOOT_VERSION %s\n" "\"$KERNELVERSION\""
59 #See if the build is running in a git repo and the git command is available
60 printf "/* timesource: $TIMESOURCE */\n"
61 printf "#define COREBOOT_VERSION_TIMESTAMP $DATE\n"
62 printf "#define COREBOOT_ORIGIN_GIT_REVISION \"$GITREV\"\n"
64 printf "#define COREBOOT_EXTRA_VERSION \"%s\"\n" "$COREBOOT_EXTRA_VERSION"
65 printf "#define COREBOOT_MAJOR_VERSION %d\n#define COREBOOT_MINOR_VERSION %d\n" `git describe --match [0-9].[0-9]* | sed 's/\([0-9]\)\.\([0-9]\+\).*/\1 \2/'`
66 printf "#define COREBOOT_BUILD \"$(our_date "$DATE")\"\n"
67 printf "#define COREBOOT_BUILD_YEAR_BCD 0x$(our_date "$DATE" +%y)\n"
68 printf "#define COREBOOT_BUILD_MONTH_BCD 0x$(our_date "$DATE" +%m)\n"
69 printf "#define COREBOOT_BUILD_DAY_BCD 0x$(our_date "$DATE" +%d)\n"
70 printf "#define COREBOOT_BUILD_WEEKDAY_BCD 0x$(our_date "$DATE" +%w)\n"
71 printf "#define COREBOOT_DMI_DATE \"$(our_date "$DATE" +%m/%d/%Y)\"\n"
73 printf "#define COREBOOT_COMPILE_TIME \"$(our_date "$DATE" +%T)\"\n"
74 printf "#define ASL_VERSION 0x%d\n" `$IASL -v | grep version | sed 's/.*version //'`