Fixed use of negative indices when first directory entry has no long name.
[tangerine.git] / arch / common / grub2 / mmakefile.src
blob2d46ef7ddc6e5dd2c98dee55315a02e57acab1c1
1 # Copyright © 2004, The AROS Development Team. All rights reserved.
2 # $Id$
4 include $(TOP)/config/make.cfg
6 #MM- arch-common-grub2 : grub2 grub2-copy-stages
8 GRUB2MODDIR := $(AROSDIR)/boot/grub2
9 GRUB2IMGDIR := $(CONTRIBDIR)/boot/grub2
11 GRUB2DEFMENU := $(TOP)/$(CURDIR)/../menu.lst
12 GRUB2OPTS := --enable-preset-menu=$(GRUB2DEFMENU)
14 ifneq ($(AROS_TARGET_VARIANT),tiny)
15 GRUB2OPTS += 
16 else
17 GRUB2OPTS += --disable-fat --disable-ffs --disable-minix --disable-reiserfs \
18             --disable-vstafs --disable-jfs --disable-xfs --disable-md5-password \
19             --disable-packet-retransmission --disable-ext2fs --disable-serial \
20             --disable-hercules
21 endif
23 #MM- config-native-boot-grub2 : grub2-quick grub2-copy-stages
25 CFLAGS := -minline-all-stringops
26 export CFLAGS
28 %build_with_configure mmake=grub2 compiler=host install_target= \
29     extraoptions="$(GRUBOPTS)"
31 GRUB2MODULES := $(foreach                                         \
32                    f,                                           \
33                    $(wildcard                                   \
34                            $(GENDIR)/$(CURDIR)/*.mod            \
35                    ),                                           \
36                    $(subst $(GENDIR)/$(CURDIR)/,$(GRUB2MODDIR)/,$f) \
37               )
39 GRUB2IMAGES := $(foreach                                         \
40                    f,                                           \
41                    $(wildcard                                   \
42                            $(GENDIR)/$(CURDIR)/*.img            \
43                    ),                                           \
44                    $(subst $(GENDIR)/$(CURDIR)/,$(GRUB2IMGDIR)/,$f) \
45               )
47 $(warning GRUB2MODULES = $(GRUB2MODULES))
48 $(warning GRUB2IMAGES = $(GRUB2IMAGES))
50 #MM
51 grub2-copy-stages : grub2-setup $(GRUB2MODULES) $(GRUB2IMAGES)
53 $(GRUB2MODDIR)/%.mod: $(GENDIR)/$(CURDIR)/%.mod
54         %mkdirs_q $(dir $@)
55         @$(CP) $< $@
57 $(GRUB2IMGDIR)/%.img: $(GENDIR)/$(CURDIR)/%.img
58         %mkdirs_q $(dir $@)
59         @$(CP) $< $@
61 #MM
62 grub2-setup :
63         %mkdirs_q $(GRUB2MODDIR) $(GRUB2IMGDIR)