Forward compatibility: build relative-base link libraries where needed
[AROS.git] / arch / all-pc / boot / grub2-host / mmakefile.src
blobf90d63260dc2def18dc7a8ff2d60153fb838dda3
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
10 BOOT_GRUB := $(AROSARCHDIR)/grub
11 BOOT_EFI  := $(AROSDIR)/EFI/BOOT/grub
13 $(BOOT_GRUB):
14         %mkdirs_q $@
16 $(BOOT_GRUB)/i386-pc:
17         %mkdirs_q $@
19 $(BOOT_EFI):
20         %mkdirs_q $@
22 $(BOOT_EFI)/i386-efi:
23         %mkdirs_q $@
25 #MM
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)
29                 $(CP) $< $(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)
35                 $(CP) $< $(BOOT_EFI)
37 $(BOOT_EFI)/_unicode.pf2: unicode.pf2 $(BOOT_EFI)
38                 $(CP) $< $(BOOT_EFI)/_unicode.pf2
40 #MM
41 bootloader-grub2gfx-common-livecd: $(BOOT_GRUB)/unicode.pf2 $(BOOT_EFI)/unicode.pf2
43 $(BOOT_GRUB)/unicode.pf2: unicode.pf2 $(BOOT_GRUB)
44                 $(CP) $< $(BOOT_GRUB)
46 $(BOOT_EFI)/unicode.pf2: unicode.pf2 $(BOOT_EFI)
47                 $(CP) $< $(BOOT_EFI)
49 # avoid the make.tmpl s_flag in order to disable stripping of binaries
50 export DEBUG            := yes
51 # remove all flags, just in case
52 export HOST_CFLAGS      := 
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                           \
63                 --disable-werror                                \
64                 --program-prefix=
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"     \
69         install_target=
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"   \
74         install_target=
76 PC_MODS     := biosdisk
77 EFI_MODS    :=
78 GRUB2_MODS  :=  fshelp part_msdos part_amiga part_gpt \
79                 fat ntfs ntfscomp affs sfs ext2 hfsplus iso9660 \
80                 minicmd
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
85 ifeq ($(CPU),x86_64)
86     EFI_GRUB_IMG := BOOTX64.EFI
87 else
88     EFI_GRUB_IMG := BOOTIA32.EFI
89 endif
91 #MM
92 grub2-iso-setup: grub2-pc-iso-setup grub2-efi-iso-setup
94 #MM
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
113 %common