syslinux.mk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ################################################################################
  2. #
  3. # syslinux to make target msdos/iso9660 filesystems bootable
  4. #
  5. ################################################################################
  6. SYSLINUX_VERSION = 6.02
  7. SYSLINUX_SOURCE = syslinux-$(SYSLINUX_VERSION).tar.xz
  8. SYSLINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/
  9. SYSLINUX_LICENSE = GPLv2+
  10. SYSLINUX_LICENSE_FILES = COPYING
  11. SYSLINUX_INSTALL_IMAGES = YES
  12. SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
  13. # The syslinux tarball comes with pre-compiled binaries.
  14. # Since timestamps might not be in the correct order, a rebuild is
  15. # not always triggered for all the different images.
  16. # Cleanup the mess even before we attempt a build, so we indeed
  17. # build everything from source.
  18. define SYSLINUX_CLEANUP
  19. rm -rf $(@D)/bios $(@D)/efi32 $(@D)/efi64
  20. endef
  21. SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
  22. # syslinux build system has no convenient way to pass CFLAGS,
  23. # and the internal zlib should take precedence so -I shouldn't
  24. # be used.
  25. define SYSLINUX_BUILD_CMDS
  26. $(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
  27. AR="$(HOSTAR)" -C $(@D) bios
  28. endef
  29. # While the actual bootloader is compiled for the target, several
  30. # utilities for installing the bootloader are meant for the host.
  31. # Repeat the target, otherwise syslinux will try to build everything
  32. # Repeat CC and AR, since syslinux really wants to check them at
  33. # install time
  34. define SYSLINUX_INSTALL_TARGET_CMDS
  35. $(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
  36. AR="$(HOSTAR)" INSTALLROOT=$(HOST_DIR) \
  37. -C $(@D) bios install
  38. endef
  39. SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
  40. SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
  41. define SYSLINUX_INSTALL_IMAGES_CMDS
  42. for i in $(SYSLINUX_IMAGES-y); do \
  43. $(INSTALL) -D -m 0755 $(@D)/$$i $(BINARIES_DIR)/$${i##*/}; \
  44. done
  45. endef
  46. $(eval $(generic-package))