2009-10-09 17:50:31 +00:00
|
|
|
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
2009-10-24 10:43:49 +00:00
|
|
|
COMMON_ASFLAGS += -nostdinc
|
2009-12-30 14:31:45 +00:00
|
|
|
COMMON_CFLAGS += -ffreestanding -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
|
2009-10-09 17:50:31 +00:00
|
|
|
COMMON_LDFLAGS += -nostdlib
|
|
|
|
|
|
|
|
# Used by various components. These rules need to precede them.
|
2009-12-02 13:28:11 +00:00
|
|
|
script/lexer.c_DEPENDENCIES = grub_script.tab.h
|
2009-10-09 17:50:31 +00:00
|
|
|
|
|
|
|
# Images.
|
|
|
|
|
|
|
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
|
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
|
|
|
|
kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
|
|
|
|
env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
|
|
|
|
symbol.h term.h time.h types.h loader.h partition.h \
|
|
|
|
msdos_partition.h machine/kernel.h handler.h list.h \
|
2010-01-23 12:30:24 +00:00
|
|
|
command.h machine/memory.h cpu/libgcc.h cpu/cache.h i18n.h mm_private.h
|
2009-10-09 17:50:31 +00:00
|
|
|
|
2010-01-20 07:04:01 +00:00
|
|
|
ifeq ($(platform), yeeloong)
|
|
|
|
kernel_img_HEADERS += pci.h
|
|
|
|
endif
|
|
|
|
|
2009-10-09 17:50:31 +00:00
|
|
|
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
|
|
|
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
|
|
|
|
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
|
|
|
|
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
|
|
|
|
# Scripts.
|
2009-10-10 11:30:14 +00:00
|
|
|
sbin_SCRIPTS =
|
|
|
|
bin_SCRIPTS =
|
2009-10-09 17:50:31 +00:00
|
|
|
|
2009-10-18 13:04:14 +00:00
|
|
|
# For grub-mkimage.
|
|
|
|
bin_UTILITIES += grub-mkimage
|
2009-11-22 01:55:07 +00:00
|
|
|
grub_mkimage_SOURCES = gnulib/progname.c util/grub-mkrawimage.c util/misc.c \
|
2009-10-18 13:04:14 +00:00
|
|
|
util/resolve.c lib/LzmaEnc.c lib/LzFind.c
|
2009-10-24 10:43:49 +00:00
|
|
|
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(LINK_BASE)
|
2009-12-05 17:46:28 +00:00
|
|
|
util/grub-mkrawimage.c_DEPENDENCIES = Makefile
|
2009-10-18 13:04:14 +00:00
|
|
|
|
2009-10-09 17:50:31 +00:00
|
|
|
# Modules.
|
|
|
|
pkglib_MODULES = memdisk.mod \
|
|
|
|
lsmmap.mod
|
|
|
|
|
|
|
|
# For boot.mod.
|
|
|
|
pkglib_MODULES += boot.mod
|
|
|
|
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
|
|
|
|
boot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For memdisk.mod.
|
|
|
|
memdisk_mod_SOURCES = disk/memdisk.c
|
|
|
|
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For lsmmap.mod
|
|
|
|
lsmmap_mod_SOURCES = commands/lsmmap.c
|
|
|
|
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
2009-10-11 00:07:52 +00:00
|
|
|
# For serial.mod.
|
|
|
|
pkglib_MODULES += serial.mod
|
|
|
|
serial_mod_SOURCES = term/serial.c
|
|
|
|
serial_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
2009-10-11 21:00:22 +00:00
|
|
|
# For relocator.mod.
|
|
|
|
pkglib_MODULES += relocator.mod
|
2010-01-23 12:30:24 +00:00
|
|
|
relocator_mod_SOURCES = lib/$(target_cpu)/relocator.c lib/relocator.c lib/$(target_cpu)/relocator_asm.S
|
2009-10-11 21:00:22 +00:00
|
|
|
relocator_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
relocator_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
relocator_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
2009-10-17 10:18:39 +00:00
|
|
|
pkglib_MODULES += linux.mod
|
|
|
|
linux_mod_SOURCES = loader/$(target_cpu)/linux.c
|
|
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
2009-10-09 17:50:31 +00:00
|
|
|
include $(srcdir)/conf/common.mk
|