2010-08-20 12:51:31 +00:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2010-08-20 04:44:29 +00:00
|
|
|
# Platform specific options
|
|
|
|
if COND_i386_pc
|
|
|
|
CFLAGS_PLATFORM = -mrtd -mregparm=3
|
|
|
|
endif
|
|
|
|
if COND_i386_efi
|
|
|
|
LDFLAGS_PLATFORM = -melf_i386
|
|
|
|
endif
|
|
|
|
if COND_x86_64_efi
|
|
|
|
LDFLAGS_PLATFORM = -melf_x86_64
|
|
|
|
endif
|
|
|
|
if COND_i386_qemu
|
|
|
|
CFLAGS_PLATFORM = -mrtd -mregparm=3
|
|
|
|
endif
|
|
|
|
if COND_i386_coreboot
|
|
|
|
CFLAGS_PLATFORM = -mrtd -mregparm=3
|
|
|
|
endif
|
|
|
|
if COND_i386_ieee1275
|
|
|
|
CFLAGS_PLATFORM = -mrtd -mregparm=3
|
|
|
|
endif
|
|
|
|
if COND_mips_yeeloong
|
|
|
|
CFLAGS_PLATFORM = -march=mips3 -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
|
|
|
|
CCASFLAGS_PLATFORM = -march=mips3
|
|
|
|
endif
|
|
|
|
if COND_sparc64_ieee1275
|
|
|
|
CFLAGS_PLATFORM = -mno-app-regs
|
|
|
|
LDFLAGS_PLATFORM = -melf64_sparc -mno-relax
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Other options
|
|
|
|
|
2010-08-20 05:40:42 +00:00
|
|
|
CPPFLAGS_DEFAULT = -DGRUB_FILE=\"`echo $< | sed "s@$(top_srcdir)/@@g"`\"
|
2010-08-20 04:44:29 +00:00
|
|
|
CPPFLAGS_DEFAULT += -I$(builddir)
|
|
|
|
CPPFLAGS_DEFAULT += -I$(srcdir)
|
|
|
|
CPPFLAGS_DEFAULT += -I$(top_builddir)
|
|
|
|
CPPFLAGS_DEFAULT += -I$(top_srcdir)
|
|
|
|
CPPFLAGS_DEFAULT += -I$(top_srcdir)/include
|
|
|
|
CPPFLAGS_DEFAULT += -I$(top_builddir)/include
|
|
|
|
CCASFLAGS_DEFAULT = -DASM_FILE=1
|
|
|
|
|
|
|
|
LDADD_KERNEL = -lgcc
|
|
|
|
CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
|
|
|
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N -static-libgcc
|
|
|
|
CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
|
|
|
CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
2010-08-20 05:40:42 +00:00
|
|
|
STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment
|
2010-08-20 04:44:29 +00:00
|
|
|
|
|
|
|
CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
|
|
|
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-r,-d
|
|
|
|
CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
|
|
|
CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
|
|
|
|
|
|
|
CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin
|
|
|
|
LDFLAGS_IMAGE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-S
|
|
|
|
CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
|
|
|
CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
|
|
|
|
|
|
|
CFLAGS_PROGRAM =
|
|
|
|
LDFLAGS_PROGRAM =
|
|
|
|
CPPFLAGS_PROGRAM =
|
|
|
|
CCASFLAGS_PROGRAM =
|
|
|
|
|
|
|
|
CFLAGS_LIBRARY = $(CFLAGS_PROGRAM)
|
|
|
|
CPPFLAGS_LIBRARY = $(CPPFLAGS_PROGRAM)
|
|
|
|
CCASFLAGS_LIBRARY = $(CCASFLAGS_PROGRAM)
|
|
|
|
|
|
|
|
# Other variables
|
|
|
|
|
|
|
|
grubconfdir = $(sysconfdir)/grub.d
|
|
|
|
platformdir = $(pkglibrootdir)/$(target_cpu)-$(platform)
|
|
|
|
|
|
|
|
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
|
|
|
|
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
|
|
|
|
|
|
|
|
CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -D_GL_UNUSED="__attribute__ ((unused))"
|
|
|
|
CPPFLAGS_GNULIB = -I$(top_srcdir)/grub-core/gnulib
|
|
|
|
|
|
|
|
CFLAGS_MKISOFS = -Wno-all -Werror
|
|
|
|
CPPFLAGS_MKISOFS = -D_FILE_OFFSET_BITS=64 -I$(top_srcdir)/util/mkisofs/include
|
|
|
|
|
|
|
|
CFLAGS_POSIX = -fno-builtin
|
|
|
|
CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap
|
|
|
|
|
|
|
|
CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
|
|
|
|
|
|
|
|
# Define these variables to calm down automake
|
|
|
|
|
|
|
|
FS_FILES =
|
|
|
|
DEF_FILES =
|
|
|
|
UND_FILES =
|
|
|
|
IMG_FILES =
|
|
|
|
MOD_FILES =
|
|
|
|
VIDEO_FILES =
|
|
|
|
MODULE_FILES =
|
|
|
|
HANDLER_FILES =
|
|
|
|
PARTMAP_FILES =
|
|
|
|
COMMAND_FILES =
|
|
|
|
PARTTOOL_FILES =
|
|
|
|
TERMINAL_FILES =
|
|
|
|
KERNEL_HEADER_FILES =
|
|
|
|
|
|
|
|
man_MANS =
|
|
|
|
noinst_DATA =
|
|
|
|
bin_SCRIPTS =
|
|
|
|
sbin_SCRIPTS =
|
|
|
|
bin_PROGRAMS =
|
|
|
|
platform_DATA =
|
|
|
|
sbin_PROGRAMS =
|
|
|
|
check_SCRIPTS =
|
|
|
|
grubconf_DATA =
|
|
|
|
check_PROGRAMS =
|
|
|
|
pkglib_SCRIPTS =
|
|
|
|
noinst_PROGRAMS =
|
|
|
|
grubconf_SCRIPTS =
|
|
|
|
noinst_LIBRARIES =
|
|
|
|
|
|
|
|
TESTS =
|
|
|
|
EXTRA_DIST =
|
|
|
|
CLEANFILES =
|
|
|
|
BUILT_SOURCES =
|
2010-08-20 12:51:31 +00:00
|
|
|
|
|
|
|
# Rules for autogen definition files
|
|
|
|
|
|
|
|
.PRECIOUS: $(top_srcdir)/Makefile.tpl
|
|
|
|
$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
|
|
|
|
python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
|
|
mv $@.new $@
|
|
|
|
|
|
|
|
.PRECIOUS: $(top_srcdir)/Makefile.util.am
|
|
|
|
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.tpl
|
|
|
|
autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
|
|
mv $@.new $@
|
|
|
|
|
|
|
|
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
|
|
|
|
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/Makefile.tpl
|
|
|
|
autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
|
|
mv $@.new $@
|
|
|
|
|
|
|
|
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.gcry.am
|
|
|
|
$(top_srcdir)/grub-core/Makefile.gcry.am: $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl
|
|
|
|
autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
|
|
mv $@.new $@
|