summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-12-28 13:47:45 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-12-28 13:47:45 -0500
commita45f20c0266103ed948d4a644e6d6d1c33a90b38 (patch)
tree4ad5d5e02ccded7feeac0a9b7f9e39490949a39f /Makefile
parent63508d43f3c2f558c04065041919706cf2a86ef4 (diff)
refactor
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 $@ < $<