5d063cdc10
* configure.ac: Rename yeeloong platform to loongson. All users updated. * grub-core/Makefile.core.def (fwstart_fuloong): New image. * grub-core/boot/mips/loongson/fuloong.S: New file. * grub-core/boot/mips/loongson/fwstart.S: Wait for CS5536 to come up. Explicitly init CS5536. [FULOONG]: Don't use serial until CS5536 is available. Set GPIO based on dumps. (serial_hw_init) [FULOONG]: Handle CS5536 parts. [FULOONG]: Handle GPIO and memory controller differences. Parse machine type in $a2. * grub-core/boot/mips/startup_raw.S: Determine and save the architecture. * grub-core/bus/cs5536.c (gpiodump): Move to fwstart.S. (grub_cs5536_init_geode): Remove gpio part. Conditionalise DIVIL init on architecture type. * grub-core/kern/mips/loongson/init.c (grub_machine_init): Init SIS315E. Don't init at_keyboard on fuloong. (grub_halt): Support Fuloong. * grub-core/kern/mips/startup.S [LOONGSON]: Save $s7. * grub-core/loader/mips/linux.c (LOONGSON_MACHTYPE): Removed. (loongson_machtypes): New array. (grub_cmd_linux) [GRUB_MACHINE_MIPS_LOONGSON]: Pass the right machine type. * grub-core/term/ns8250.c (serial_get_divisor): New parameter port and config. All users updated. Handle CS5536 serial. * grub-core/term/serial.c (grub_serial_register): Conditionalise default port on machine type. Register serial as inactive. * grub-core/video/sis315pro.c: New file. * include/grub/cs5536.h (GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED): New definition. (GRUB_CS5536_MSR_MAILBOX_CONFIG): Likewise. (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1): Likewise. (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3): Likewise. (GRUB_CS5536_MSR_DIVIL_UART1_CONF): Likewise. (GRUB_CS5536_MSR_DIVIL_UART2_CONF): Likewise. * include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_SHUTDOWN_GPIO): Rename to ... (GRUB_CPU_YEELOONG_SHUTDOWN_GPIO): ... this. * include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_YEELOONG): New definition. (GRUB_ARCH_MACHINE_FULOONG): Likewise. (grub_arch_machine): New extern var. * include/grub/mips/loongson/serial.h (GRUB_MACHINE_SERIAL_DIVISOR_115200): Renamed to ... (GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200): ... this. (GRUB_MACHINE_SERIAL_PORT): Renamed to ... (GRUB_MACHINE_SERIAL_PORT0): ... this. (GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200): New definition. (GRUB_MACHINE_SERIAL_PORT1): Likewise. (GRUB_MACHINE_SERIAL_PORT2): Likewise. (GRUB_MACHINE_SERIAL_PORTS): Include ports 1 and 2. * include/grub/term.h (grub_term_register_input_inactive): New inline function. (grub_term_register_output_inactive): Likewise. * include/grub/video.h (grub_video_driver_id): New value GRUB_VIDEO_DRIVER_SIS315PRO. * util/grub-mkimage.c (image_target_desc): Rename name to dirname. New field "names". All users updated. New field value IMAGE_FULOONG_FLASH. (generate_image): USe separate fwstart hashes for yeeloong and fuloong.
177 lines
5.4 KiB
Makefile
177 lines
5.4 KiB
Makefile
# -*- makefile -*-
|
|
|
|
CFLAGS_PLATFORM=
|
|
|
|
export LC_COLLATE := C
|
|
export LC_CTYPE := C
|
|
unexport LC_ALL
|
|
|
|
# Platform specific options
|
|
if COND_i386_pc
|
|
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
|
endif
|
|
if COND_i386_efi
|
|
LDFLAGS_PLATFORM = -melf_i386
|
|
endif
|
|
if COND_x86_64_efi
|
|
LDFLAGS_PLATFORM = -melf_x86_64
|
|
endif
|
|
if COND_i386_qemu
|
|
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
|
endif
|
|
if COND_i386_coreboot
|
|
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
|
endif
|
|
if COND_i386_ieee1275
|
|
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
|
endif
|
|
if COND_mips_loongson
|
|
CFLAGS_PLATFORM += -mexplicit-relocs
|
|
CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
|
|
CCASFLAGS_PLATFORM = -march=mips3
|
|
endif
|
|
if COND_mips
|
|
CFLAGS_PLATFORM += -mflush-func=grub_cpu_flush_cache
|
|
endif
|
|
if COND_sparc64_ieee1275
|
|
CFLAGS_PLATFORM += -mno-app-regs
|
|
LDFLAGS_PLATFORM = -melf64_sparc -mno-relax
|
|
endif
|
|
|
|
# Other options
|
|
|
|
CPPFLAGS_DEFAULT = -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\"
|
|
CPPFLAGS_DEFAULT += -I$(builddir)
|
|
CPPFLAGS_DEFAULT += -I$(srcdir)
|
|
CPPFLAGS_DEFAULT += -I$(top_builddir)
|
|
CPPFLAGS_DEFAULT += -I$(top_srcdir)
|
|
CPPFLAGS_DEFAULT += -I$(top_srcdir)/include
|
|
CPPFLAGS_DEFAULT += -I$(top_builddir)/include
|
|
CCASFLAGS_DEFAULT = -DASM_FILE=1
|
|
|
|
LDADD_KERNEL =
|
|
|
|
if ! COND_i386_pc
|
|
if ! COND_i386_efi
|
|
if ! COND_i386_qemu
|
|
if ! COND_i386_coreboot
|
|
if ! COND_i386_multiboot
|
|
if ! COND_i386_ieee1275
|
|
if ! COND_x86_64_efi
|
|
LDADD_KERNEL += -lgcc
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
|
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N -static-libgcc
|
|
CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
|
CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
|
if COND_CYGWIN
|
|
STRIPFLAGS_KERNEL = -F elf32-i386 -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve
|
|
else
|
|
STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment
|
|
endif
|
|
|
|
CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
|
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-r,-d
|
|
CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
|
CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
|
|
|
CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin
|
|
LDFLAGS_IMAGE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-S
|
|
CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
|
CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
|
|
|
CFLAGS_PROGRAM =
|
|
LDFLAGS_PROGRAM =
|
|
CPPFLAGS_PROGRAM =
|
|
CCASFLAGS_PROGRAM =
|
|
|
|
CFLAGS_LIBRARY =
|
|
CPPFLAGS_LIBRARY =
|
|
CCASFLAGS_LIBRARY =
|
|
|
|
# Other variables
|
|
|
|
grubconfdir = $(sysconfdir)/grub.d
|
|
grubdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`
|
|
platformdir = $(pkglibrootdir)/$(target_cpu)-$(platform)
|
|
|
|
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
|
|
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
|
|
|
|
CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter
|
|
CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
|
|
|
|
CFLAGS_POSIX = -fno-builtin
|
|
CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap
|
|
|
|
CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
|
|
|
|
# List file macros for recognizing /interesting/ modules
|
|
CPPFLAGS_FS_LIST = -Dgrub_fs_register=FS_LIST_MARKER
|
|
CPPFLAGS_VIDEO_LIST= -Dgrub_video_register=VIDEO_LIST_MARKER
|
|
CPPFLAGS_PARTMAP_LIST = -Dgrub_partition_map_register=PARTMAP_LIST_MARKER
|
|
CPPFLAGS_PARTTOOL_LIST = -Dgrub_parttool_register=PARTTOOL_LIST_MARKER
|
|
CPPFLAGS_TERMINAL_LIST = '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)'
|
|
CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)'
|
|
CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)'
|
|
CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)'
|
|
CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)'
|
|
CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \
|
|
$(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \
|
|
$(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST)
|
|
|
|
# Define these variables to calm down automake
|
|
|
|
IMG_FILES =
|
|
MOD_FILES =
|
|
MODULE_FILES =
|
|
MARKER_FILES =
|
|
KERNEL_HEADER_FILES =
|
|
|
|
man_MANS =
|
|
noinst_DATA =
|
|
pkglib_DATA =
|
|
bin_SCRIPTS =
|
|
sbin_SCRIPTS =
|
|
bin_PROGRAMS =
|
|
platform_DATA =
|
|
sbin_PROGRAMS =
|
|
check_SCRIPTS =
|
|
grubconf_DATA =
|
|
check_PROGRAMS =
|
|
noinst_SCRIPTS =
|
|
pkglib_SCRIPTS =
|
|
noinst_PROGRAMS =
|
|
grubconf_SCRIPTS =
|
|
noinst_LIBRARIES =
|
|
dist_noinst_DATA =
|
|
|
|
TESTS =
|
|
EXTRA_DIST =
|
|
CLEANFILES =
|
|
BUILT_SOURCES =
|
|
|
|
# Rules for autogen definition files
|
|
|
|
.PRECIOUS: $(top_srcdir)/Makefile.tpl
|
|
$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
|
|
python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
mv $@.new $@
|
|
|
|
.PRECIOUS: $(top_srcdir)/Makefile.util.am
|
|
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.tpl
|
|
autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
mv $@.new $@
|
|
|
|
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
|
|
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl
|
|
if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
|
|
autogen -T $(top_srcdir)/Makefile.tpl $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
|
mv $@.new $@
|