2009-10-09 17:50:31 +00:00
|
|
|
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
2009-10-24 10:43:49 +00:00
|
|
|
COMMON_ASFLAGS += -nostdinc
|
|
|
|
COMMON_CFLAGS += -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 \
|
2009-11-25 22:17:32 +00:00
|
|
|
command.h machine/memory.h cpu/libgcc.h cpu/cache.h i18n.h
|
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)
|
|
|
|
|
|
|
|
# Programs
|
2009-10-18 12:10:31 +00:00
|
|
|
pkglib_IMAGES = kernel.img
|
|
|
|
kernel_img_SOURCES = kern/$(target_cpu)/startup.S \
|
2009-10-24 10:43:49 +00:00
|
|
|
kern/main.c kern/device.c kern/$(target_cpu)/init.c \
|
|
|
|
kern/$(target_cpu)/$(target_machine)/init.c \
|
2009-10-09 17:50:31 +00:00
|
|
|
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
|
|
|
|
kern/misc.c kern/mm.c kern/reader.c kern/term.c \
|
|
|
|
kern/rescue_parser.c kern/rescue_reader.c \
|
|
|
|
kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
|
|
|
|
kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \
|
2009-10-11 00:07:52 +00:00
|
|
|
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c kern/time.c \
|
2009-10-09 17:50:31 +00:00
|
|
|
symlist.c kern/$(target_cpu)/cache.S
|
|
|
|
kernel_img_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
|
|
|
|
-Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
|
2009-10-18 12:10:31 +00:00
|
|
|
kernel_img_FORMAT = binary
|
2009-10-09 17:50:31 +00:00
|
|
|
|
|
|
|
# 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-10-18 13:04:14 +00:00
|
|
|
util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile
|
|
|
|
|
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
|
|
|
|
relocator_mod_SOURCES = lib/$(target_cpu)/relocator.c lib/$(target_cpu)/relocator_asm.S
|
|
|
|
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
|