python-psutil: bump to version 4.3.0
[buildroot-gz.git] / boot / syslinux / syslinux.mk
blob82890c5dc973fcd5a1efa20081a246c4c652b465
1 ################################################################################
3 # syslinux to make target msdos/iso9660 filesystems bootable
5 ################################################################################
7 SYSLINUX_VERSION = 6.03
8 SYSLINUX_SOURCE = syslinux-$(SYSLINUX_VERSION).tar.xz
9 SYSLINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux
11 SYSLINUX_LICENSE = GPLv2+
12 SYSLINUX_LICENSE_FILES = COPYING
14 SYSLINUX_INSTALL_IMAGES = YES
16 SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
18 ifeq ($(BR2_TARGET_SYSLINUX_LEGACY_BIOS),y)
19 SYSLINUX_TARGET += bios
20 endif
22 # The syslinux build system must be forced to use Buildroot's gnu-efi
23 # package by setting EFIINC, LIBDIR and LIBEFI. Otherwise, it uses its
24 # own copy of gnu-efi included in syslinux's sources since 6.03
25 # release.
26 ifeq ($(BR2_TARGET_SYSLINUX_EFI),y)
27 ifeq ($(BR2_ARCH_IS_64),y)
28 SYSLINUX_EFI_BITS = efi64
29 else
30 SYSLINUX_EFI_BITS = efi32
31 endif # 64-bit
32 SYSLINUX_DEPENDENCIES += gnu-efi
33 SYSLINUX_TARGET += $(SYSLINUX_EFI_BITS)
34 SYSLINUX_EFI_ARGS = \
35 EFIINC=$(STAGING_DIR)/usr/include/efi \
36 LIBDIR=$(STAGING_DIR)/usr/lib \
37 LIBEFI=$(STAGING_DIR)/usr/lib/libefi.a
38 endif # EFI
40 # The syslinux tarball comes with pre-compiled binaries.
41 # Since timestamps might not be in the correct order, a rebuild is
42 # not always triggered for all the different images.
43 # Cleanup the mess even before we attempt a build, so we indeed
44 # build everything from source.
45 define SYSLINUX_CLEANUP
46 rm -rf $(@D)/bios $(@D)/efi32 $(@D)/efi64
47 endef
48 SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
50 # syslinux build system has no convenient way to pass CFLAGS,
51 # and the internal zlib should take precedence so -I shouldn't
52 # be used.
53 define SYSLINUX_BUILD_CMDS
54 $(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
55 AR="$(HOSTAR)" $(SYSLINUX_EFI_ARGS) -C $(@D) $(SYSLINUX_TARGET)
56 endef
58 # While the actual bootloader is compiled for the target, several
59 # utilities for installing the bootloader are meant for the host.
60 # Repeat the target, otherwise syslinux will try to build everything
61 # Repeat CC and AR, since syslinux really wants to check them at
62 # install time
63 define SYSLINUX_INSTALL_TARGET_CMDS
64 $(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
65 AR="$(HOSTAR)" $(SYSLINUX_EFI_ARGS) INSTALLROOT=$(HOST_DIR) \
66 -C $(@D) $(SYSLINUX_TARGET) install
67 endef
69 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
70 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
71 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_MBR) += bios/mbr/mbr.bin
72 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_EFI) += $(SYSLINUX_EFI_BITS)/efi/syslinux.efi
74 SYSLINUX_C32 = $(call qstrip,$(BR2_TARGET_SYSLINUX_C32))
76 # We install the c32 modules from the host-installed tree, where they
77 # are all neatly installed in a single location, while they are
78 # scattered around everywhere in the build tree.
79 define SYSLINUX_INSTALL_IMAGES_CMDS
80 for i in $(SYSLINUX_IMAGES-y); do \
81 $(INSTALL) -D -m 0755 $(@D)/$$i $(BINARIES_DIR)/syslinux/$${i##*/}; \
82 done
83 for i in $(SYSLINUX_C32); do \
84 $(INSTALL) -D -m 0755 $(HOST_DIR)/usr/share/syslinux/$${i} \
85 $(BINARIES_DIR)/syslinux/$${i}; \
86 done
87 endef
89 $(eval $(generic-package))