revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / arch / all-pc / boot / grub2-host / mmakefile.src
blob702555b7794a7cabec704e48173a8385f27c1018
1 # $Id$
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)
18 $(BOOT_GRUB):
19         %mkdirs_q $@
21 $(BOOT_GRUB)/fonts:
22         %mkdirs_q $@
24 $(BOOT_GRUB)/i386-pc:
25         %mkdirs_q $@
27 $(BOOT_EFI):
28         %mkdirs_q $@
30 $(BOOT_EFI)/fonts:
31         %mkdirs_q $@
33 $(BOOT_EFI)/i386-efi:
34         %mkdirs_q $@
36 #MM
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)
40                 $(CP) $< $(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)
46                 $(CP) $< $(BOOT_EFI)
48 $(BOOT_EFI)/fonts/_unicode.pf2: unicode.pf2 $(BOOT_EFI)/fonts
49                 $(CP) $< $(BOOT_EFI)/fonts/_unicode.pf2
51 #MM
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
55                 $(CP) $< $(BOOT_GRUB)
57 $(BOOT_EFI)/fonts/unicode.pf2: unicode.pf2 $(BOOT_EFI)/fonts
58                 $(CP) $< $(BOOT_EFI)
60 # avoid the make.tmpl s_flag in order to disable stripping of binaries
61 export DEBUG            := yes
62 # remove all flags, just in case
63 export HOST_CFLAGS      := 
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                           \
74                 --disable-werror                                \
75                 --program-prefix=
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=
87 PC_MODS     := biosdisk
88 EFI_MODS    :=
89 GRUB2_MODS  :=  fshelp part_msdos part_amiga part_gpt \
90                 fat ntfs ntfscomp affs sfs ext2 hfsplus iso9660 \
91                 minicmd
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
96 ifeq ($(CPU),x86_64)
97     EFI_GRUB_IMG := BOOTX64.EFI
98 else
99     EFI_GRUB_IMG := BOOTIA32.EFI
100 endif
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
124 %common