2009-08-12 17:00:51 +02:00
|
|
|
#######################################################################
|
|
|
|
# Take care of subdirectories
|
|
|
|
subdirs-y += boot
|
|
|
|
subdirs-y += init
|
|
|
|
subdirs-y += lib
|
|
|
|
subdirs-y += smp
|
|
|
|
|
2009-08-25 14:18:05 +02:00
|
|
|
obj-$(CONFIG_HAVE_OPTION_TABLE) += ../../option_table.o
|
2009-08-12 17:00:51 +02:00
|
|
|
|
|
|
|
ifdef POST_EVALUATION
|
2009-08-13 17:29:01 +02:00
|
|
|
|
2009-08-12 17:00:51 +02:00
|
|
|
#######################################################################
|
|
|
|
# Build the final rom image
|
2009-12-23 13:52:56 +01:00
|
|
|
$(obj)/coreboot.rom: $(obj)/coreboot.pre $(obj)/coreboot_ram $(CBFSTOOL)
|
|
|
|
cp $(obj)/coreboot.pre $@
|
2009-08-25 21:38:46 +02:00
|
|
|
if [ -f fallback/coreboot_apc ]; \
|
2009-08-12 17:00:51 +02:00
|
|
|
then \
|
2009-08-25 21:38:46 +02:00
|
|
|
$(CBFSTOOL) $@ add-stage fallback/coreboot_apc fallback/coreboot_apc $(CBFS_COMPRESS_FLAG); \
|
2009-08-12 17:00:51 +02:00
|
|
|
fi
|
2009-10-28 00:14:54 +01:00
|
|
|
$(CBFSTOOL) $@ add-stage $(obj)/coreboot_ram fallback/coreboot_ram $(CBFS_COMPRESS_FLAG)
|
2009-08-12 17:00:51 +02:00
|
|
|
ifeq ($(CONFIG_PAYLOAD_NONE),y)
|
2009-08-25 17:03:20 +02:00
|
|
|
@printf " PAYLOAD none (as specified by user)\n"
|
2009-08-12 17:00:51 +02:00
|
|
|
else
|
2009-10-28 00:14:54 +01:00
|
|
|
@printf " PAYLOAD $(CONFIG_FALLBACK_PAYLOAD_FILE) $(CBFS_PAYLOAD_COMPRESS_FLAG)\n"
|
2009-10-28 16:30:11 +01:00
|
|
|
$(CBFSTOOL) $(obj)/coreboot.rom add-payload $(CONFIG_FALLBACK_PAYLOAD_FILE) fallback/payload $(CBFS_PAYLOAD_COMPRESS_FLAG)
|
2009-10-23 14:14:15 +02:00
|
|
|
endif
|
2009-08-17 16:46:13 +02:00
|
|
|
ifeq ($(CONFIG_VGA_BIOS),y)
|
2009-08-25 17:03:20 +02:00
|
|
|
@printf " VGABIOS $(CONFIG_FALLBACK_VGA_BIOS_FILE) $(CONFIG_FALLBACK_VGA_BIOS_ID)\n"
|
2009-10-28 16:30:11 +01:00
|
|
|
$(CBFSTOOL) $(obj)/coreboot.rom add $(CONFIG_FALLBACK_VGA_BIOS_FILE) "pci$(CONFIG_FALLBACK_VGA_BIOS_ID).rom" optionrom
|
2009-08-17 16:46:13 +02:00
|
|
|
endif
|
2009-10-28 18:10:51 +01:00
|
|
|
@printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n"
|
2009-10-28 16:30:11 +01:00
|
|
|
$(CBFSTOOL) $(obj)/coreboot.rom print
|
2009-08-12 17:00:51 +02:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# i386 specific tools
|
|
|
|
|
2009-12-23 13:52:56 +01:00
|
|
|
$(obj)/option_table.h $(obj)/option_table.c $(obj)/arch/i386/../../option_table.c: $(obj)/build_opt_tbl $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout
|
2009-10-28 18:10:51 +01:00
|
|
|
@printf " OPTION $(subst $(obj)/,,$(@))\n"
|
2009-08-25 21:38:46 +02:00
|
|
|
$(obj)/build_opt_tbl --config $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout --header $(obj)/option_table.h --option $(obj)/option_table.c
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2009-09-24 18:56:08 +02:00
|
|
|
$(obj)/build_opt_tbl: $(top)/util/options/build_opt_tbl.c $(top)/src/include/pc80/mc146818rtc.h $(top)/src/include/boot/coreboot_tables.h $(obj)/config.h
|
2009-10-28 18:10:51 +01:00
|
|
|
@printf " HOSTCC $(subst $(obj)/,,$(@))\n"
|
2009-08-25 21:38:46 +02:00
|
|
|
$(HOSTCC) $(HOSTCFLAGS) -include $(obj)/config.h $< -o $@
|
2009-08-12 17:00:51 +02:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Build the coreboot_ram (stage 2)
|
|
|
|
|
|
|
|
$(obj)/coreboot_ram: $(obj)/coreboot_ram.o $(src)/config/coreboot_ram.ld #ldoptions
|
2009-10-28 18:10:51 +01:00
|
|
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
2009-08-25 21:38:46 +02:00
|
|
|
$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(src)/config/coreboot_ram.ld $(obj)/coreboot_ram.o
|
|
|
|
$(NM) -n $(obj)/coreboot_ram | sort > $(obj)/coreboot_ram.map
|
2009-08-12 17:00:51 +02:00
|
|
|
|
|
|
|
$(obj)/coreboot_ram.o: $(obj)/arch/i386/lib/c_start.o $(drivers) $(obj)/coreboot.a $(LIBGCC_FILE_NAME)
|
2009-10-28 18:10:51 +01:00
|
|
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
2009-08-25 21:38:46 +02:00
|
|
|
$(CC) -nostdlib -r -o $@ $(obj)/arch/i386/lib/c_start.o $(drivers) -Wl,-\( $(obj)/coreboot.a $(LIBGCC_FILE_NAME) -Wl,-\)
|
2009-08-12 17:00:51 +02:00
|
|
|
|
|
|
|
$(obj)/coreboot.a: $(objs)
|
2009-10-28 18:10:51 +01:00
|
|
|
@printf " AR $(subst $(obj)/,,$(@))\n"
|
2009-08-25 21:38:46 +02:00
|
|
|
rm -f $(obj)/coreboot.a
|
|
|
|
$(AR) cr $(obj)/coreboot.a $(objs)
|
2009-08-12 17:00:51 +02:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# done
|
|
|
|
|
|
|
|
endif
|
2009-12-23 13:52:56 +01:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_TINY_BOOTBLOCK),y)
|
|
|
|
include $(src)/arch/i386/Makefile.tinybootblock.inc
|
|
|
|
else
|
|
|
|
include $(src)/arch/i386/Makefile.bigbootblock.inc
|
|
|
|
endif
|