aboutsummaryrefslogtreecommitdiff
path: root/grub/makefile
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-03-09 20:09:32 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-03-09 20:20:05 +0200
commit17ef04cc82101dfd33187e98a77cea19293c0fae (patch)
tree1c8f4ff38511214bfef73294d37a3137eb7c2450 /grub/makefile
parentMap kernel to higher half (diff)
downloadkernel.cpp-17ef04cc82101dfd33187e98a77cea19293c0fae.tar.xz
Move elf and iso to builddir
Diffstat (limited to 'grub/makefile')
-rw-r--r--grub/makefile37
1 files changed, 17 insertions, 20 deletions
diff --git a/grub/makefile b/grub/makefile
index 014b061..a2c2f85 100644
--- a/grub/makefile
+++ b/grub/makefile
@@ -1,26 +1,23 @@
-CURL := curl -OL
-GPG := gpg
+GRUBSRC := grub-2.04
+DESTDIR != printf $$(pwd)/tools
+TARBALL := grub-2.04.tar.xz
+URL := https://ftp.gnu.org/gnu/grub/$(TARBALL)
-F := grub-2.04.tar.xz
-srcdir := $(F:%.tar.xz=%)
-dstdir := $(F:%.tar.xz=%-tools)
+$(TARBALL):
+ @curl $(URL) --output $@
+$(TARBALL).sig:
+ @curl $(URL).sig --output $@
-default:
- @echo $(SRCDIR)
+download: $(TARBALL) $(TARBALL).sig
-$(F):
- $(CURL) https://ftp.gnu.org/gnu/grub/$(F)
+verify: $(TARBALL) $(TARBALL).sig
+ @gpg --verify $(TARBALL).sig
-$(F).sig:
- $(CURL) https://ftp.gnu.org/gnu/grub/$(F).sig
-
-verify: $(F) $(F).sig
- $(GPG) --verify $(F).sig
-
-build: $(F)
- tar -xf $(F)
- cd $(srcdir) && CC=clang BUILD_CC=clang TARGET_CC=clang ./configure --disable-werror --prefix=/
- make -C $(srcdir) -j6 DESTDIR=$(CURDIR)/$(dstdir) install
+# grub requires GNU Make to build
+build: $(TARBALL)
+ tar -xf $(TARBALL)
+ cd $(GRUBSRC) && CC=clang BUILD_CC=clang TARGET_CC=clang ./configure --disable-werror --prefix=/
+ make -C $(GRUBSRC) -j$(nproc) DESTDIR=$(DESTDIR) install
clean:
- rm $(F) $(F).sig
+ rm -rf $(TARBALL) $(TARBALL).sig $(GRUBSRC) $(DESTDIR)