3 # This file is part of the coreboot project.
5 # Copyright (C) 2014 Sage Electronic Engineering, LLC.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; version 2 of the License.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
25 if [ "${BUILD_TIMELESS}" = "1" ]; then
29 elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
30 GITREV
=$
(LANG
= git log
-1 --format=format
:%h
)
32 DATE
=$
(git log
--pretty=format
:%ct
-1)
36 DATE
=$
(LANG
= LC_ALL
=C TZ
=UTC0
date +%s
)
41 NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin
)
49 #Print out the information that goes into build.h
50 printf "/* build system definitions (autogenerated) */\n"
51 printf "#ifndef __BUILD_H\n"
52 printf "#define __BUILD_H\n\n"
53 printf "#define COREBOOT_VERSION %s\n" "\"$KERNELVERSION\""
55 #See if the build is running in a git repo and the git command is available
56 printf "/* timesource: $TIMESOURCE */\n"
57 printf "#define COREBOOT_VERSION_TIMESTAMP $DATE\n"
58 printf "#define COREBOOT_ORIGIN_GIT_REVISION \"$GITREV\"\n"
60 printf "#define COREBOOT_EXTRA_VERSION \"%s\"\n" "$COREBOOT_EXTRA_VERSION"
61 printf "#define COREBOOT_BUILD \"$(our_date "$DATE")\"\n"
62 printf "#define COREBOOT_BUILD_YEAR_BCD 0x$(our_date "$DATE" +%y)\n"
63 printf "#define COREBOOT_BUILD_MONTH_BCD 0x$(our_date "$DATE" +%m)\n"
64 printf "#define COREBOOT_BUILD_DAY_BCD 0x$(our_date "$DATE" +%d)\n"
65 printf "#define COREBOOT_BUILD_WEEKDAY_BCD 0x$(our_date "$DATE" +%w)\n"
66 printf "#define COREBOOT_DMI_DATE \"$(our_date "$DATE" +%m/%d/%Y)\"\n"
68 printf "#define COREBOOT_COMPILE_TIME \"$(our_date "$DATE" +%T)\"\n"