1 # Copyright © 2004-2010, The AROS Development Team. All rights reserved.
3 # just for building the grub2 utils
4 # in prevision to use grub-mkimage in InstallAROS
6 include $(SRCDIR)/config/aros.cfg
8 ##MM- AROS-pc-$(CPU) : grub2-aros-quick
9 #MM- arch-common-grub2 : grub2-aros-quick
11 EXCL_FLAGS := -Werror -Werror-implicit-function-declaration
13 # remove the -s & --strip-all flags, just in case
14 # ... to no strip grub_mod_init or something from modules
15 CFLAGS1 := $(filter-out -mcmodel=large -s --strip-all $(EXCL_FLAGS),$(HOST_CFLAGS))
16 CFLAGS2 := $(filter-out -mcmodel=large -s --strip-all $(EXCL_FLAGS),$(CFLAGS))
18 # avoid the make.tmpl s_flag in order to disable stripping of binaries
19 # WE SHOULD FIND A WORKAROUND AGAINST THIS HACK, I didn't check if extract
20 # code is linked in grub modules & utils
23 # trick make.tmpl %build_with_configure compiler=host (what a hack)
24 export TARGET_CFLAGS := $(CFLAGS1) # grub target cflags
25 export HOST_CC := $(TARGET_CC) # aros target cc
26 export CFLAGS := $(CFLAGS2) # aros target cflags
27 export KERNEL_CFLAGS := # undef
28 export HOST_CFLAGS := # undef
30 ifeq ($(AROS_TARGET_VARIANT),efi)
36 # override %(mmake)-install_opts in make.tmpl
37 # because if compiler=host, nix_dir_layout can't be used
38 DESTDIR := $(AROS_CONTRIB)/GNU
39 INSTALL_ENV := bindir=$(DESTDIR)/bin sbindir=$(DESTDIR)/sbin
40 CONFIG_OPTS := --build=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
41 --host=$(AROS_TARGET_CPU)-aros \
42 --with-platform=$(GRUB_ARCH) \
43 --datarootdir=$(DESTDIR)/share \
44 --sysconfdir=$(DESTDIR)/etc \
45 --disable-grub-mkfont \
49 %build_with_configure mmake=grub2-aros compiler=host \
50 prefix="$(DESTDIR)" aros_prefix="/GNU" nix=yes \
51 extraoptions="$(CONFIG_OPTS)" \
52 install_env="$(INSTALL_ENV)"