# -*- makefile -*-
- COMMON_LDFLAGS += -nostdlib
--COMMON_CFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -fno-builtin
-
- # Used by various components. These rules need to precede them.
- script/lexer.c_DEPENDENCIES = grub_script.tab.h
++COMMON_CFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include)
-util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
kernel_img_RELOCATABLE = yes
pkglib_PROGRAMS = kernel.img
kernel_img_SOURCES = kern/device.c kern/disk.c kern/dl.c kern/env.c \
kern/rescue_reader.c kern/rescue_parser.c \
\
util/console.c util/grub-emu.c util/misc.c \
- util/hostdisk.c util/getroot.c util/time.c \
+ util/hostdisk.c util/getroot.c util/mm.c util/time.c \
\
- grub_emu_init.c gnulib/progname.c util/hostfs.c disk/host.c
-kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-undef -I$(srcdir)/gnulib
+ gnulib/progname.c util/hostfs.c disk/host.c
- 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 loader.h misc.h mm.h net.h parser.h \
- partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
- list.h handler.h command.h i18n.h env_private.h
++kernel_img_HEADERS += datetime.h
+kernel_img_CFLAGS = $(CPPFLAGS) $(CFLAGS) -Wno-undef
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
TARGET_NO_STRIP = yes
-TARGET_NO_DYNAMIC_MODULES = yes
+
+ifneq ($(TARGET_NO_MODULES), yes)
+kernel_img_SOURCES += symlist.c kern/$(target_cpu)/dl.c
+ifneq ($(target_cpu), i386)
+ifneq ($(target_cpu), x86_64)
+kernel_img_SOURCES += kern/$(target_cpu)/cache.S
+endif
+endif
+else
+kernel_img_SOURCES += grub_emu_init.c
+endif
# For halt.mod.
pkglib_MODULES += halt.mod
kern/handler.c kern/err.c kern/parser.c kern/list.c \
kern/misc.c kern/env.c grub_script_check_init.c grub_script.tab.c
- machine/memory.h machine/loader.h machine/kernel.h \
+ 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 loader.h misc.h mm.h net.h parser.h \
+ partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
+ list.h handler.h command.h i18n.h env_private.h
+
++ifneq ($(platform), emu)
++kernel_img_HEADERS += machine/memory.h machine/loader.h machine/kernel.h
++endif
++
+ 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)
+
# For the parser.
grub_script.tab.c grub_script.tab.h: script/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/parser.y