opengnsys_ipxe/src
Masahiro Yamada 37c2d10e0c fix build error in a shallow-cloned source tree
Cloning the repository with the --depth option is useful when you do
not need the full git history, but it fails to build core/version.c

  $ git clone --depth 1 git://git.ipxe.org/ipxe.git
  $ cd ipxe/src
  $ make
   [snip]
      [VERSION] bin/version.ipxe.dsk.o
  In file included from include/ipxe/features.h:6,
                   from core/version.c:33:
  <command-line>: error: unsigned conversion from ‘int’ to ‘unsigned char’ changes value from ‘9062’ to ‘102’ [-Werror=overflow]
  include/ipxe/dhcp.h:529:58: note: in definition of macro ‘DHCP_OPTION’
    529 | #define DHCP_OPTION( ... ) VA_ARG_COUNT ( __VA_ARGS__ ), __VA_ARGS__
        |                                                          ^~~~~~~~~~~
    ...

A shallow-cloned repository may not have any tag at all, then it returns
only a commit hash.

  $ git describe --tags --always --long --abbrev=1 --match "v*"
  9062

In such a case, VERSION_MINOR becomes empty, causing the build error.

If 'git describe' does not find any tag, let the version macros fall
back to the default:

  VERSION_MAJOR   = 1
  VERSION_MINOR   = 0
  VERSION_PATCH   = 0
  EXTRAVERSION    = +

Setting sha1 to GITVERSION is still useful.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-12-04 10:50:22 +09:00
..
arch [acpi] Generalise DSDT/SSDT data extraction logic 2021-09-08 14:46:30 +01:00
bin Rename .cvsignore files to .gitignore 2007-06-09 22:57:00 +01:00
config [cloud] Retry DHCP aggressively in AWS EC2 2021-07-20 13:19:15 +01:00
core [uri] Retain original encodings for path, query, and fragment fields 2021-11-12 09:58:29 +00:00
crypto [x509] Use case-insensitive comparison for certificate names 2021-05-18 11:46:28 +01:00
doc [build] Rename gPXE to iPXE 2010-04-19 23:43:39 +01:00
drivers [efi] Run ExitBootServices shutdown hook at TPL_NOTIFY 2021-11-23 15:55:01 +00:00
hci [readline] Extend maximum read line length to 1024 characters 2021-09-10 15:51:14 +01:00
image [image] Allow single-member archive images to be executed transparently 2021-05-12 13:57:35 +01:00
include [efi] Run ExitBootServices shutdown hook at TPL_NOTIFY 2021-11-23 15:55:01 +00:00
interface [efi] Disable EFI watchdog timer when shutting down to boot an OS 2021-11-25 09:30:59 +00:00
libgcc [libgcc] Change __divmoddi4 from int64 [unknown] to int64_t 2020-07-21 14:33:32 +01:00
net [uri] Retain original encodings for path, query, and fragment fields 2021-11-12 09:58:29 +00:00
scripts [efi] Align EFI image sections by page size 2021-04-10 13:43:47 +01:00
tests [uri] Retain original encodings for path, query, and fragment fields 2021-11-12 09:58:29 +00:00
usr [uri] Retain original encodings for path, query, and fragment fields 2021-11-12 09:58:29 +00:00
util [build] Include EFI system partition table entry in isohybrid images 2021-11-23 15:26:55 +00:00
.gitignore [build] Add support for local configuration files 2010-03-26 19:07:22 +00:00
Makefile fix build error in a shallow-cloned source tree 2021-12-04 10:50:22 +09:00
Makefile.efi [efi] Use zero for PCI vendor/device IDs when no applicable ID exists 2021-07-26 15:47:47 +01:00
Makefile.housekeeping [build] Fix building on broken versions of GNU binutils 2021-06-17 14:37:39 +01:00
Makefile.linux [linux] Place -lslirp at end of linker search list 2021-03-03 01:09:33 +00:00
doxygen.cfg [build] Remove PACKED macro 2010-05-29 23:49:47 +01:00