Files
CoreMP135_buildroot/boot/syslinux/syslinux.mk
T

116 lines
3.8 KiB
Makefile
Raw Normal View History

2013-06-06 21:54:13 +00:00
################################################################################
#
# syslinux to make target msdos/iso9660 filesystems bootable
#
2013-06-06 21:54:13 +00:00
################################################################################
2015-03-03 22:33:07 +01:00
SYSLINUX_VERSION = 6.03
SYSLINUX_SOURCE = syslinux-$(SYSLINUX_VERSION).tar.xz
SYSLINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux
SYSLINUX_LICENSE = GPL-2.0+
2012-08-18 10:25:39 +01:00
SYSLINUX_LICENSE_FILES = COPYING
2011-07-05 21:54:04 +02:00
SYSLINUX_INSTALL_IMAGES = YES
# host-util-linux needed to provide libuuid when building host tools
SYSLINUX_DEPENDENCIES = \
host-nasm \
host-python3 \
host-upx \
host-util-linux \
util-linux
2014-05-02 19:10:34 +02:00
ifeq ($(BR2_TARGET_SYSLINUX_LEGACY_BIOS),y)
SYSLINUX_TARGET += bios
endif
2015-03-03 22:33:07 +01:00
# The syslinux build system must be forced to use Buildroot's gnu-efi
# package by setting EFIINC, LIBDIR and LIBEFI. Otherwise, it uses its
# own copy of gnu-efi included in syslinux's sources since 6.03
# release.
ifeq ($(BR2_TARGET_SYSLINUX_EFI),y)
ifeq ($(BR2_ARCH_IS_64),y)
SYSLINUX_EFI_BITS = efi64
else
SYSLINUX_EFI_BITS = efi32
endif # 64-bit
SYSLINUX_DEPENDENCIES += gnu-efi
SYSLINUX_TARGET += $(SYSLINUX_EFI_BITS)
2015-03-03 22:33:07 +01:00
SYSLINUX_EFI_ARGS = \
EFIINC=$(STAGING_DIR)/usr/include/efi \
LIBDIR=$(STAGING_DIR)/usr/lib \
LIBEFI=$(STAGING_DIR)/usr/lib/libefi.a
endif # EFI
2014-05-02 19:10:34 +02:00
# The syslinux tarball comes with pre-compiled binaries.
# Since timestamps might not be in the correct order, a rebuild is
# not always triggered for all the different images.
# Cleanup the mess even before we attempt a build, so we indeed
# build everything from source.
define SYSLINUX_CLEANUP
rm -rf $(@D)/bios $(@D)/efi32 $(@D)/efi64
endef
SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
2012-07-05 22:01:31 +02:00
# syslinux build system has no convenient way to pass CFLAGS,
# and the internal zlib should take precedence so -I shouldn't
# be used.
2011-07-05 21:54:04 +02:00
define SYSLINUX_BUILD_CMDS
2017-04-07 11:05:13 +02:00
$(TARGET_MAKE_ENV) $(MAKE1) \
2022-08-14 22:20:57 +02:00
ASCIIDOC_OK=-1 \
A2X_XML_OK=-1 \
2017-04-07 11:05:13 +02:00
CC="$(TARGET_CC)" \
LD="$(TARGET_LD)" \
2021-10-25 12:23:31 +03:00
OBJCOPY="$(TARGET_OBJCOPY)" \
AS="$(TARGET_AS)" \
NASM="$(HOST_DIR)/bin/nasm" \
2017-04-07 11:05:13 +02:00
CC_FOR_BUILD="$(HOSTCC)" \
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
PYTHON=$(HOST_DIR)/bin/python3 \
2018-04-01 02:08:16 -03:00
$(SYSLINUX_EFI_ARGS) -C $(@D) $(SYSLINUX_TARGET)
2011-07-05 21:54:04 +02:00
endef
# While the actual bootloader is compiled for the target, several
# utilities for installing the bootloader are meant for the host.
2014-05-02 19:10:34 +02:00
# Repeat the target, otherwise syslinux will try to build everything
2017-04-07 11:05:13 +02:00
# Repeat LD (and CC) as it happens that some binaries are linked at
# install-time.
define SYSLINUX_INSTALL_TARGET_CMDS
2017-04-07 11:05:13 +02:00
$(TARGET_MAKE_ENV) $(MAKE1) $(SYSLINUX_EFI_ARGS) INSTALLROOT=$(HOST_DIR) \
CC="$(TARGET_CC)" \
LD="$(TARGET_LD)" \
2015-03-03 22:33:07 +01:00
-C $(@D) $(SYSLINUX_TARGET) install
endef
2017-04-07 11:05:13 +02:00
# That 'syslinux' binary is an installer actually built for the target.
# However, buildroot makes no usage of it, so better delete it than have it
# installed at the wrong place
define SYSLINUX_POST_INSTALL_CLEANUP
rm -rf $(HOST_DIR)/bin/syslinux
2017-04-07 11:05:13 +02:00
endef
SYSLINUX_POST_INSTALL_TARGET_HOOKS += SYSLINUX_POST_INSTALL_CLEANUP
2014-05-02 19:10:34 +02:00
SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_MBR) += bios/mbr/mbr.bin
SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_EFI) += $(SYSLINUX_EFI_BITS)/efi/syslinux.efi
SYSLINUX_C32 = $(call qstrip,$(BR2_TARGET_SYSLINUX_C32))
# We install the c32 modules from the host-installed tree, where they
# are all neatly installed in a single location, while they are
# scattered around everywhere in the build tree.
2011-07-05 21:54:04 +02:00
define SYSLINUX_INSTALL_IMAGES_CMDS
for i in $(SYSLINUX_IMAGES-y); do \
$(INSTALL) -D -m 0755 $(@D)/$$i $(BINARIES_DIR)/syslinux/$${i##*/}; \
2011-07-05 21:54:04 +02:00
done
for i in $(SYSLINUX_C32); do \
$(INSTALL) -D -m 0755 $(HOST_DIR)/share/syslinux/$${i} \
2015-03-03 22:33:07 +01:00
$(BINARIES_DIR)/syslinux/$${i}; \
done
2011-07-05 21:54:04 +02:00
endef
2010-03-16 21:50:16 +01:00
$(eval $(generic-package))