make: Sort object files for reproducible linking order
[syslinux.git] / efi / clean-gnu-efi.sh
blob58def28c2033295df6eae07d0ecded73ebae248b
1 #!/bin/sh
3 set -e
5 # Initialise the gnu-efi submodule and ensure the source is up-to-date.
6 # Then build and install it for the given architecture.
8 if [ $# -lt 2 ]; then
9 cat <<EOF
10 Usage: $0: <arch> <objdir>
12 Build the <arch> gnu-efi libs and header files and install in <objdir>.
14 <arch> - A gnu-efi \$ARCH argument, i.e. ia32, x86_64
15 <objdir> - The Syslinux object directory
17 EOF
18 exit 1
21 ARCH="$1"
22 objdir=$(readlink -f "$2")
25 cd ../..
26 if [ -d .git ]; then
27 git submodule update --init
31 if [ -d "$objdir/gnu-efi" ];then
32 cd "$objdir/gnu-efi"
33 EFIDIR="$(readlink -f "$objdir/../gnu-efi/gnu-efi-3.0")"
34 make SRCDIR="$EFIDIR" TOPDIR="$EFIDIR" -f "$EFIDIR/Makefile" ARCH=$ARCH clean
37 cd "$objdir/efi"