204 lines
9.5 KiB
Makefile
204 lines
9.5 KiB
Makefile
# -*- makefile -*-
|
|
|
|
KERNEL_HEADER_FILES =
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cache.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/elf.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/elfload.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/file.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fs.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i18n.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/kernel.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/list.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/misc.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/parser.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/partition.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/reader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/symbol.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/term.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/types.h
|
|
|
|
if COND_i386_pc
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/biosdisk.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/boot.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/console.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/vga.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/vbe.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pxe.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
|
endif
|
|
|
|
if COND_i386_efi
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/time.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
|
endif
|
|
|
|
if COND_i386_coreboot
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/boot.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/console.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/init.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
|
|
endif
|
|
|
|
if COND_i386_multiboot
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/boot.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/console.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/init.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
|
|
endif
|
|
|
|
if COND_i386_qemu
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/boot.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/console.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/init.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
|
|
endif
|
|
|
|
if COND_i386_ieee1275
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
|
|
endif
|
|
|
|
if COND_x86_64_efi
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/time.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
|
endif
|
|
|
|
if COND_mips_yeeloong
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cs5536.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pci.h
|
|
endif
|
|
|
|
if COND_powerpc_ieee1275
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h
|
|
endif
|
|
|
|
if COND_sparc64_ieee1275
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/msdos_partition.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sparc64/ieee1275/ieee1275.h
|
|
endif
|
|
|
|
if COND_emu
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/time.h
|
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/types.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gzio.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/menu.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/datetime.h
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/misc.h
|
|
if COND_GRUB_EMU_SDL
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h
|
|
endif
|
|
if COND_GRUB_EMU_USB
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libusb.h
|
|
endif
|
|
if COND_GRUB_EMU_PCI
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libpciaccess.h
|
|
endif
|
|
endif
|
|
|
|
symlist.h: $(top_builddir)/config.h $(KERNEL_HEADER_FILES)
|
|
@list='$^'; \
|
|
for p in $$list; do \
|
|
echo "#include <$$p>" >> $@ || (rm -f $@; exit 1); \
|
|
done
|
|
CLEANFILES += symlist.h
|
|
BUILT_SOURCES += symlist.h
|
|
|
|
symlist.c: symlist.h gensymlist.sh
|
|
$(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) -DGRUB_SYMBOL_GENERATOR=1 symlist.h > symlist.p || (rm -f symlist.p; exit 1)
|
|
cat symlist.p | /bin/sh $(srcdir)/gensymlist.sh $(top_builddir)/config.h $(KERNEL_HEADER_FILES) >$@ || (rm -f $@; exit 1)
|
|
rm -f symlist.p
|
|
CLEANFILES += symlist.c
|
|
BUILT_SOURCES += symlist.c
|
|
|
|
noinst_DATA += kernel_syms.lst
|
|
kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h
|
|
$(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input
|
|
if grep "^#define HAVE_ASM_USCORE" $(top_builddir)/config.h; then u="_"; else u=""; fi; \
|
|
cat kernel_syms.input | grep -v '^#' | sed -n \
|
|
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
|
|
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
|
|
| sort -u >$@
|
|
rm -f kernel_syms.input
|
|
CLEANFILES += kernel_syms.lst
|
|
|
|
if COND_emu
|
|
kern/emu/grub_emu-main.$(OBJEXT):grub_emu_init.h
|
|
grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h
|
|
kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h
|
|
grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h
|
|
|
|
grub_emu_init.h: genemuinitheader.sh $(MOD_FILES)
|
|
rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(NM) > $@
|
|
CLEANFILES += grub_emu_init.h
|
|
|
|
grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES)
|
|
rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(NM) > $@
|
|
CLEANFILES += grub_emu_init.c
|
|
endif
|