3 include $(SRCDIR)/config/aros.cfg
5 #MM- arch-common-grub2-host : grub2-host-quick grub2-efi-host-quick
6 #MM grub2-iso-setup : grub2-host-quick grub2-efi-host-quick grub2-aros-quick
7 #MM- bootloader-grub2 : arch-common-grub2
8 #MM- bootloader-grub2-isosetup : arch-common-grub2 grub2-iso-setup
9 #MM grub2-host : grub2-aros-fetch
10 #MM- grub2-host-quick : grub2-aros-fetch
11 #MM grub2-efi-host : grub2-aros-fetch
12 #MM- grub2-efi-host-quick : grub2-aros-fetch
14 BOOT_GRUB := $(AROSARCHDIR)/grub
15 BOOT_EFI := $(AROSDIR)/EFI/BOOT/grub
16 GRUBSRCDIR := $(PORTSDIR)/grub/grub-$(GRUB2_VERSION)
37 bootloader-grub2gfx-common: $(BOOT_GRUB)/splash.png $(BOOT_GRUB)/fonts/_unicode.pf2 $(BOOT_EFI)/splash.png $(BOOT_EFI)/fonts/_unicode.pf2
39 $(BOOT_GRUB)/splash.png: splash.png $(BOOT_GRUB)
42 $(BOOT_GRUB)/fonts/_unicode.pf2: unicode.pf2 $(BOOT_GRUB)/fonts
43 $(CP) $< $(BOOT_GRUB)/fonts/_unicode.pf2
45 $(BOOT_EFI)/splash.png: splash.png $(BOOT_EFI)
48 $(BOOT_EFI)/fonts/_unicode.pf2: unicode.pf2 $(BOOT_EFI)/fonts
49 $(CP) $< $(BOOT_EFI)/fonts/_unicode.pf2
52 bootloader-grub2gfx-common-livecd: $(BOOT_GRUB)/fonts/unicode.pf2 $(BOOT_EFI)/fonts/unicode.pf2
54 $(BOOT_GRUB)/fonts/unicode.pf2: unicode.pf2 $(BOOT_GRUB)/fonts
57 $(BOOT_EFI)/fonts/unicode.pf2: unicode.pf2 $(BOOT_EFI)/fonts
60 # avoid the make.tmpl s_flag in order to disable stripping of binaries
62 # remove all flags, just in case
64 export KERNEL_CFLAGS :=
65 export CONFIG_LDFLAGS :=
67 DESTDIR := $(HOSTGENDIR)/$(CURDIR)/host_binaries
68 CONFIG_OPTS := --build=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
69 --host=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
70 --target=$(AROS_TARGET_CPU) \
71 --datarootdir=$(DESTDIR)/share \
72 --sysconfdir=$(DESTDIR)/etc \
73 --disable-grub-mkfont \
77 %build_with_configure mmake=grub2-host compiler=host nix=yes \
78 prefix="$(DESTDIR)" srcdir=$(GRUBSRCDIR) \
79 package=pc extraoptions="$(CONFIG_OPTS) --with-platform=pc" \
80 install_target= targetisaflags=
82 %build_with_configure mmake=grub2-efi-host compiler=host nix=yes \
83 prefix="$(DESTDIR)" srcdir=$(GRUBSRCDIR) \
84 package=efi extraoptions="$(CONFIG_OPTS) --with-platform=efi" \
85 install_target= targetisaflags=
89 GRUB2_MODS := fshelp part_msdos part_amiga part_gpt \
90 fat ntfs ntfscomp affs sfs ext2 hfsplus iso9660 \
92 LST_FILES := command fs moddep
93 MKIMG_OPTS := -O i386-pc -p /$(AROS_DIR_ARCH)/grub
94 MKIMG_EFI := -O $(AROS_TARGET_CPU)-efi -p /EFI/BOOT/grub
97 EFI_GRUB_IMG := BOOTX64.EFI
99 EFI_GRUB_IMG := BOOTIA32.EFI
103 grub2-iso-setup: grub2-pc-iso-setup grub2-efi-iso-setup
106 grub2-pc-iso-setup: $(BOOT_GRUB)/i386-pc
107 @$(ECHO) Creating $(BOOT_GRUB)...
108 @cd $(HOSTGENDIR)/$(CURDIR)/pc/grub-core && \
109 ../grub-mkimage $(MKIMG_OPTS) -d . -o core.img $(PC_MODS) $(GRUB2_MODS) && \
110 $(CP) *.img $(BOOT_GRUB)/i386-pc && \
111 $(CP) *.mod $(BOOT_GRUB)/i386-pc && \
112 $(CP) $(addsuffix .lst,$(LST_FILES)) $(BOOT_GRUB)/i386-pc && \
113 $(CAT) cdboot.img core.img > $(BOOT_GRUB)/i386-pc/grub2_eltorito
116 grub2-efi-iso-setup: $(BOOT_EFI)/i386-efi
117 @$(ECHO) Creating $(BOOT_EFI)...
118 @cd $(HOSTGENDIR)/$(CURDIR)/efi/grub-core && \
119 ../grub-mkimage $(MKIMG_EFI) -d . -o grub.efi $(EFI_MODS) $(GRUB2_MODS) && \
120 $(CP) grub.efi $(AROSDIR)/EFI/BOOT/$(EFI_GRUB_IMG) && \
121 $(CP) *.mod $(BOOT_EFI)/i386-efi && \
122 $(CP) $(addsuffix .lst,$(LST_FILES)) $(BOOT_EFI)/i386-efi