]> git.armaanb.net Git - asd-repo.git/blobdiff - extra/efivar/build
efivar, efibootmgr: move to extra
[asd-repo.git] / extra / efivar / build
diff --git a/extra/efivar/build b/extra/efivar/build
new file mode 100755 (executable)
index 0000000..762b19f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# LTO is used when CFLAGS are unset causing a compilation
+# error with GCC 10. LTO can be set by the user though
+# '-flto-partition=none' is also needed.
+sed -i 's/ -flto//' Make.defaults
+
+for patch in *.patch; do
+    patch -p1 < "$patch"
+done
+
+# Avoid repeating ourselves.
+mk() {
+    make \
+        libdir=/usr/lib/ \
+        bindir=/usr/bin/ \
+        mandir=/usr/share/man/ \
+        includedir=/usr/include/ \
+        "$@"
+}
+
+mk CC="${CC:-cc}"
+mk DESTDIR="$1" install