b977bf01b3
* util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to ... (GRUB_TARGET_SIZEOF_VOID_P): ... this. (GRUB_HOST_SIZEOF_LONG): Renamed to ... (GRUB_TARGET_SIZEOF_LONG): ... this. (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ... (GRUB_TARGET_WORDS_BIGENDIAN): ... this. * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG instead of GRUB_HOST_SIZEOF_LONG. [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of GRUB_HOST_WORDS_BIGENDIAN to define or undefine GRUB_CPU_WORDS_BIGENDIAN. Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to define grub_host_addr_t, grub_host_off_t, grub_host_size_t and grub_host_ssize_t. * conf/i386-efi.rmk (noinst_UTILITIES): Removed. (genmoddep_SOURCES): Likewise. * conf/i386-pc.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES): Likewise. (genmoddep_SOURCES): Likewise. * genmoddep.awk: New file. * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS, TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC, CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively. (PModule::rule): Likewise. (Program::rule): Likewise. (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS, respectively. * configure.ac: Rewritten intensively to use host and target instead of build and host, respectively. * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu. (host_cpu): Removed. (target_cpu): New variable. (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\". (BUILD_CC): Removed. (BUILD_CFLAGS): Likewise. (BUILD_CPPFLAGS): Likewise. (TARGET_CC): New variable. (TARGET_CFLAGS): Likewise. (TARGET_CPPFLAGS): Likewise. (TARGET_LDFLAGS): Likewise. (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
124 lines
4.2 KiB
Makefile
124 lines
4.2 KiB
Makefile
|
|
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
|
|
COMMON_CFLAGS = -ffreestanding -msoft-float
|
|
COMMON_LDFLAGS += -nostdlib
|
|
|
|
# Images.
|
|
|
|
MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
kernel_elf_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
|
file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h symbol.h \
|
|
term.h types.h powerpc/libgcc.h loader.h \
|
|
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
|
|
machine/kernel.h
|
|
|
|
kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
|
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
|
|
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
# Programs
|
|
pkgdata_PROGRAMS = kernel.elf
|
|
|
|
# Utilities.
|
|
bin_UTILITIES = grub-emu
|
|
sbin_UTILITIES = grub-mkimage
|
|
|
|
# For grub-mkimage.
|
|
grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \
|
|
util/resolve.c
|
|
|
|
# For grub-emu
|
|
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
|
commands/configfile.c commands/help.c \
|
|
commands/search.c commands/terminal.c commands/test.c \
|
|
commands/ls.c commands/blocklist.c \
|
|
commands/ieee1275/halt.c commands/ieee1275/reboot.c \
|
|
disk/loopback.c \
|
|
fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \
|
|
fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \
|
|
io/gzio.c \
|
|
kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
|
|
kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \
|
|
kern/parser.c kern/partition.c kern/rescue.c kern/term.c \
|
|
normal/arg.c normal/cmdline.c normal/command.c \
|
|
normal/completion.c normal/execute.c \
|
|
normal/function.c normal/lexer.c normal/main.c normal/menu.c \
|
|
normal/menu_entry.c normal/misc.c normal/script.c \
|
|
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
|
|
partmap/acorn.c \
|
|
util/console.c util/grub-emu.c util/misc.c \
|
|
util/i386/pc/biosdisk.c util/i386/pc/getroot.c \
|
|
util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_init.c
|
|
|
|
grub_emu_LDFLAGS = $(LIBCURSES)
|
|
|
|
kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
|
|
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
|
|
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
|
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
|
kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \
|
|
kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
|
|
kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \
|
|
kernel_elf_symlist.c kern/powerpc/cache.S
|
|
kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h
|
|
kernel_elf_CFLAGS = $(COMMON_CFLAGS)
|
|
kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
|
|
kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
|
|
-Wl,-N,-S,-Ttext,0x200000,-Bstatic
|
|
|
|
# Scripts.
|
|
sbin_SCRIPTS = grub-install
|
|
|
|
# For grub-install.
|
|
grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in
|
|
|
|
# Modules.
|
|
pkgdata_MODULES = halt.mod \
|
|
_linux.mod \
|
|
linux.mod \
|
|
normal.mod \
|
|
reboot.mod \
|
|
suspend.mod
|
|
|
|
# For _linux.mod.
|
|
_linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
|
|
_linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For linux.mod.
|
|
linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For normal.mod.
|
|
normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
|
|
normal/completion.c normal/execute.c \
|
|
normal/function.c normal/lexer.c normal/main.c normal/menu.c \
|
|
normal/menu_entry.c normal/misc.c grub_script.tab.c \
|
|
normal/script.c normal/powerpc/setjmp.S
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
# For suspend.mod
|
|
suspend_mod_SOURCES = commands/ieee1275/suspend.c
|
|
suspend_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For reboot.mod
|
|
reboot_mod_SOURCES = commands/ieee1275/reboot.c
|
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For halt.mod
|
|
halt_mod_SOURCES = commands/ieee1275/halt.c
|
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
include $(srcdir)/conf/common.mk
|