blob: 723c90bb9ad2500d2ebd7d800a10cda499f7cfec [file] [log] [blame]
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +11001################################################################################
2#
3# libflash - builds libflash libraries from skiboot source
4#
5################################################################################
6
Klaus Heinrich Kiwi0c20da62020-02-15 09:07:01 -03007LIBFLASH_VERSION = $(call qstrip,$(BR2_SKIBOOT_VERSION))
8
Vasant Hegde8465e1b2019-12-16 15:33:39 +05309ifeq ($(BR2_SKIBOOT_CUSTOM_GIT),y)
10LIBFLASH_SITE = $(call qstrip,$(BR2_SKIBOOT_CUSTOM_REPO_URL))
11LIBFLASH_SITE_METHOD = git
12else
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110013LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION))
Vasant Hegde8465e1b2019-12-16 15:33:39 +053014endif
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050015
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110016LIBFLASH_INSTALL_STAGING = YES
17LIBFLASH_INSTALL_TARGET = YES
Klaus Heinrich Kiwi0c20da62020-02-15 09:07:01 -030018LIBFLASH_DEPENDENCIES += skiboot
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110019
Stewart Smithb16ba5b2017-01-10 12:55:55 +110020LIBFLASH_LICENSE_FILES = LICENCE
21
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110022LIBFLASH_MAKE_OPTS += CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
23 AS="$(TARGET_AS)" AR="$(TARGET_AR)" NM="$(TARGET_NM)" \
24 OBJCOPY="$(TARGET_OBJCOPY)" OBJDUMP="$(TARGET_OBJDUMP)" \
25 SIZE="$(TARGET_CROSS)size"
26
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100027LIBFLASH_MAKE_ENV = \
28 SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
29 $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS)
30
31
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110032define LIBFLASH_BUILD_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100033 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared
34 $(if $(BR2_PACKAGE_PFLASH),
35 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \
36 -C $(@D)/external/pflash)
Stewart Smith52f2a862018-11-27 13:44:12 +110037 $(if $(BR2_PACKAGE_OPAL_GARD),
38 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \
39 -C $(@D)/external/gard)
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110040endef
41
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050042define HOST_LIBFLASH_BUILD_CMDS
Samuel Mendoza-Jonas70041c52017-08-30 11:01:38 +100043 $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
44 $(MAKE) -C $(@D)/external/pflash
Stewart Smith52f2a862018-11-27 13:44:12 +110045 $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
46 $(MAKE) -C $(@D)/external/gard
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050047endef
48
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110049define LIBFLASH_INSTALL_STAGING_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100050 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
51 install
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110052endef
53
54define LIBFLASH_INSTALL_TARGET_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100055 PREFIX=$(TARGET_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
56 install-lib
57 $(if $(BR2_PACKAGE_PFLASH),
58 DESTDIR=$(TARGET_DIR) $(LIBFLASH_MAKE_ENV) \
59 -C $(@D)/external/pflash install)
Stewart Smith52f2a862018-11-27 13:44:12 +110060 $(if $(BR2_PACKAGE_OPAL_GARD),
Stewart Smithacf396d2019-07-08 16:29:18 +100061 $(INSTALL) $(@D)/external/gard/opal-gard $(TARGET_DIR)/usr/bin/opal-gard)
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110062endef
63
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050064define HOST_LIBFLASH_INSTALL_CMDS
65 $(INSTALL) $(@D)/external/pflash/pflash $(HOST_DIR)/usr/bin/pflash
66endef
67
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110068$(eval $(generic-package))
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050069$(eval $(host-generic-package))