blob: c30ce87ee927384a4d1a051be0af4a757dba5ed3 [file] [log] [blame]
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +11001################################################################################
2#
3# libflash - builds libflash libraries from skiboot source
4#
5################################################################################
6
Stewart Smithacf396d2019-07-08 16:29:18 +10007LIBFLASH_VERSION = v6.4-rc1
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +11008LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION))
Charles P. Hofer0ca27df2017-08-10 14:20:00 -05009
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110010LIBFLASH_INSTALL_STAGING = YES
11LIBFLASH_INSTALL_TARGET = YES
12
Stewart Smithb16ba5b2017-01-10 12:55:55 +110013LIBFLASH_LICENSE_FILES = LICENCE
14
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110015LIBFLASH_MAKE_OPTS += CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
16 AS="$(TARGET_AS)" AR="$(TARGET_AR)" NM="$(TARGET_NM)" \
17 OBJCOPY="$(TARGET_OBJCOPY)" OBJDUMP="$(TARGET_OBJDUMP)" \
18 SIZE="$(TARGET_CROSS)size"
19
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100020LIBFLASH_MAKE_ENV = \
21 SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
22 $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS)
23
24
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110025define LIBFLASH_BUILD_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100026 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared
27 $(if $(BR2_PACKAGE_PFLASH),
28 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \
29 -C $(@D)/external/pflash)
Stewart Smith52f2a862018-11-27 13:44:12 +110030 $(if $(BR2_PACKAGE_OPAL_GARD),
31 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \
32 -C $(@D)/external/gard)
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110033endef
34
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050035define HOST_LIBFLASH_BUILD_CMDS
Samuel Mendoza-Jonas70041c52017-08-30 11:01:38 +100036 $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
37 $(MAKE) -C $(@D)/external/pflash
Stewart Smith52f2a862018-11-27 13:44:12 +110038 $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
39 $(MAKE) -C $(@D)/external/gard
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050040endef
41
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110042define LIBFLASH_INSTALL_STAGING_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100043 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
44 install
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110045endef
46
47define LIBFLASH_INSTALL_TARGET_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100048 PREFIX=$(TARGET_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
49 install-lib
50 $(if $(BR2_PACKAGE_PFLASH),
51 DESTDIR=$(TARGET_DIR) $(LIBFLASH_MAKE_ENV) \
52 -C $(@D)/external/pflash install)
Stewart Smith52f2a862018-11-27 13:44:12 +110053 $(if $(BR2_PACKAGE_OPAL_GARD),
Stewart Smithacf396d2019-07-08 16:29:18 +100054 $(INSTALL) $(@D)/external/gard/opal-gard $(TARGET_DIR)/usr/bin/opal-gard)
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110055endef
56
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050057define HOST_LIBFLASH_INSTALL_CMDS
58 $(INSTALL) $(@D)/external/pflash/pflash $(HOST_DIR)/usr/bin/pflash
59endef
60
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110061$(eval $(generic-package))
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050062$(eval $(host-generic-package))