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
10 BOOT_GRUB := $(AROSARCHDIR)/grub
11 BOOT_EFI := $(AROSDIR)/EFI/BOOT/grub
26 bootloader-grub2gfx-common: $(BOOT_GRUB)/splash.png $(BOOT_GRUB)/_unicode.pf2 $(BOOT_EFI)/splash.png $(BOOT_EFI)/_unicode.pf2
28 $(BOOT_GRUB)/splash.png: splash.png $(BOOT_GRUB)
31 $(BOOT_GRUB)/_unicode.pf2: unicode.pf2 $(BOOT_GRUB)
32 $(CP) $< $(BOOT_GRUB)/_unicode.pf2
34 $(BOOT_EFI)/splash.png: splash.png $(BOOT_EFI)
37 $(BOOT_EFI)/_unicode.pf2: unicode.pf2 $(BOOT_EFI)
38 $(CP) $< $(BOOT_EFI)/_unicode.pf2
41 bootloader-grub2gfx-common-livecd: $(BOOT_GRUB)/unicode.pf2 $(BOOT_EFI)/unicode.pf2
43 $(BOOT_GRUB)/unicode.pf2: unicode.pf2 $(BOOT_GRUB)
46 $(BOOT_EFI)/unicode.pf2: unicode.pf2 $(BOOT_EFI)
49 # avoid the make.tmpl s_flag in order to disable stripping of binaries
51 # remove all flags, just in case
53 export KERNEL_CFLAGS :=
54 export CONFIG_LDFLAGS :=
56 DESTDIR := $(HOSTGENDIR)/$(CURDIR)/host_binaries
57 CONFIG_OPTS := --build=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
58 --host=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
59 --target=$(AROS_TARGET_CPU) \
60 --datarootdir=$(DESTDIR)/share \
61 --sysconfdir=$(DESTDIR)/etc \
62 --disable-grub-mkfont \
66 %build_with_configure mmake=grub2-host compiler=host nix=yes \
67 prefix="$(DESTDIR)" srcdir=$(SRCDIR)/$(CURDIR)/../grub2-aros \
68 package=pc extraoptions="$(CONFIG_OPTS) --with-platform=pc" \
71 %build_with_configure mmake=grub2-efi-host compiler=host nix=yes \
72 prefix="$(DESTDIR)" srcdir=$(SRCDIR)/$(CURDIR)/../grub2-aros \
73 package=efi extraoptions="$(CONFIG_OPTS) --with-platform=efi" \
78 GRUB2_MODS := fshelp part_msdos part_amiga part_gpt \
79 fat ntfs ntfscomp affs sfs ext2 hfsplus iso9660 \
81 LST_FILES := command fs moddep
82 MKIMG_OPTS := -O i386-pc -p /$(AROS_DIR_ARCH)/grub
83 MKIMG_EFI := -O $(AROS_TARGET_CPU)-efi -p /EFI/BOOT/grub
86 EFI_GRUB_IMG := BOOTX64.EFI
88 EFI_GRUB_IMG := BOOTIA32.EFI
92 grub2-iso-setup: grub2-pc-iso-setup grub2-efi-iso-setup
95 grub2-pc-iso-setup: $(BOOT_GRUB)/i386-pc
96 @$(ECHO) Creating $(BOOT_GRUB)...
97 @cd $(HOSTGENDIR)/$(CURDIR)/pc/grub-core && \
98 ../grub-mkimage $(MKIMG_OPTS) -d . -o core.img $(PC_MODS) $(GRUB2_MODS) && \
99 $(CP) *.img $(BOOT_GRUB)/i386-pc && \
100 $(CP) *.mod $(BOOT_GRUB)/i386-pc && \
101 $(CP) $(addsuffix .lst,$(LST_FILES)) $(BOOT_GRUB)/i386-pc && \
102 $(CAT) cdboot.img core.img > $(BOOT_GRUB)/i386-pc/grub2_eltorito
105 grub2-efi-iso-setup: $(BOOT_EFI)/i386-efi
106 @$(ECHO) Creating $(BOOT_EFI)...
107 @cd $(HOSTGENDIR)/$(CURDIR)/efi/grub-core && \
108 ../grub-mkimage $(MKIMG_EFI) -d . -o grub.efi $(EFI_MODS) $(GRUB2_MODS) && \
109 $(CP) grub.efi $(AROSDIR)/EFI/BOOT/$(EFI_GRUB_IMG) && \
110 $(CP) *.mod $(BOOT_EFI)/i386-efi && \
111 $(CP) $(addsuffix .lst,$(LST_FILES)) $(BOOT_EFI)/i386-efi