summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..806537b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+# Just for convenience
+keymapdir = resources/utilities/grub-assemble/keymap
+
+GRUB_MKLAYOUT = src/grub/grub-mklayout
+GRUB_MKIMAGE = src/grub/grub-mkimage
+GRUB_MKSTANDALONE = src/grub/grub-mkstandalone --grub-mkimage=$(GRUB_MKIMAGE) -d src/grub/grub-core/
+CBFSTOOL = src/coreboot/util/cbfstool/cbfstool
+
+boards = x60 t60 x60t macbook21
+romtypes = txtmode vesafb
+-include $(keymapdir)/list.mk # sets "keymaps=..."
+
+i945boards = x60 x60t t60
+
+build: \
+ $(foreach board,$(boards),\
+ $(foreach keymap,$(keymaps),\
+ $(foreach romtype,$(romtypes),\
+ bin/$(board)_$(keymap)_$(romtype).rom)))
+
+
+define _nl
+
+
+endef
+
+# I wrote this between 3AM and 5AM. I have lost my sanity.
+define _loop_rule
+_loop_str := $$$$(_nl)$$$$(rule_$1)$$$$(_nl)
+_loop_str := $$$$(foreach @,$$$$$$$$@,$$(_loop_str))
+_loop_str := $$$$(foreach <,$$$$$$$$<,$$(_loop_str))
+$(foreach var,$2,_loop_str := $$$$(foreach $(var),$$$$($(var)s),$$(_loop_str))$(_nl))
+endef
+define loop_rule
+$(eval $(call _loop_rule,$1,$2))
+$(eval _loop = $(_loop_str))
+$(_loop)
+endef
+
+include modules.mk
+include build.mk
+include grub-mkstandalone.mk
+include buildrom-withgrub.mk
+
+
+
+$(keymapdir)/list.mk: $(keymapdir)/original/
+ echo keymaps = $$(ls $<) > $@
+
+resources/grub/font/dejavusansmono.pf2: src/dejavu/ttv/DejaVuSansMono.ttf $(GRUB_MKFONT)
+ $(GRUB_MKFONT) -o $@ $<
+
+# % = $(keymap)
+$(keymapdir)/keymap/%.gkb: $(keymapdir)/orignal/% builddeps-grub
+ $(GRUB_MKLAYOUT) -o $@ < $<