8 # Platform specific options
9 if COND_sparc64_ieee1275
10 CFLAGS_PLATFORM += -mno-app-regs
11 LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax
14 CFLAGS_PLATFORM += -mno-app-regs
15 LDFLAGS_PLATFORM = -Wl,--no-relax
19 LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
23 CFLAGS_PLATFORM += -mcmodel=large
26 #FIXME: discover and check XEN headers
27 CPPFLAGS_XEN = -I/usr/include
31 CPPFLAGS_DEFAULT = -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\"
32 CPPFLAGS_DEFAULT += -I$(builddir)
33 CPPFLAGS_DEFAULT += -I$(srcdir)
34 CPPFLAGS_DEFAULT += -I$(top_builddir)
35 CPPFLAGS_DEFAULT += -I$(top_srcdir)
36 CPPFLAGS_DEFAULT += -I$(top_srcdir)/include
37 CPPFLAGS_DEFAULT += -I$(top_builddir)/include
38 CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/
39 CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1
40 BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT)
42 LDADD_KERNEL = $(TARGET_LIBGCC)
44 CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding
45 LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC)
46 CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1
47 CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
48 STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version
50 CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding
51 LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d
52 CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
53 CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
55 CFLAGS_IMAGE = $(CFLAGS_PLATFORM) -fno-builtin
56 LDFLAGS_IMAGE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-S
57 CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
58 CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
71 grubconfdir = $(sysconfdir)/grub.d
72 platformdir = $(pkglibdir)/$(target_cpu)-$(platform)
73 starfielddir = $(pkgdatadir)/themes/starfield
75 CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
76 CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
78 CFLAGS_POSIX = -fno-builtin
79 CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap
81 CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers -Wno-redundant-decls -Wno-undef $(CFLAGS_POSIX)
82 CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap $(CPPFLAGS_POSIX) -D_GCRYPT_IN_LIBGCRYPT=1 -I$(top_srcdir)/include/grub/gcrypt
84 CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
86 # List file macros for recognizing /interesting/ modules
87 CPPFLAGS_FS_LIST = -Dgrub_fs_register=FS_LIST_MARKER
88 CPPFLAGS_VIDEO_LIST= -Dgrub_video_register=VIDEO_LIST_MARKER
89 CPPFLAGS_PARTMAP_LIST = -Dgrub_partition_map_register=PARTMAP_LIST_MARKER
90 CPPFLAGS_PARTTOOL_LIST = -Dgrub_parttool_register=PARTTOOL_LIST_MARKER
91 CPPFLAGS_TERMINAL_LIST = '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)'
92 CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)'
93 CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)'
94 CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)'
95 CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)'
96 CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \
97 $(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \
98 $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST)
100 # Define these variables to calm down automake
106 KERNEL_HEADER_FILES =
132 # Rules for Automake input
134 .PRECIOUS: $(top_srcdir)/Makefile.util.am
135 $(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def
136 python $^ > $@.new || (rm -f $@.new; exit 1)
139 .PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
140 $(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def
141 if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
142 python $^ > $@.new || (rm -f $@.new; exit 1)