blob: c1fe08f904ff20c89cb6c14bb0bed90e30ad1e83 [file] [log] [blame]
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +11001################################################################################
2#
3# libflash - builds libflash libraries from skiboot source
4#
5################################################################################
6
Vasant Hegde8465e1b2019-12-16 15:33:39 +05307ifeq ($(BR2_SKIBOOT_CUSTOM_GIT),y)
8LIBFLASH_SITE = $(call qstrip,$(BR2_SKIBOOT_CUSTOM_REPO_URL))
9LIBFLASH_SITE_METHOD = git
10else
11LIBFLASH_VERSION = $(call qstrip,$(BR2_SKIBOOT_VERSION))
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110012LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION))
Vasant Hegde8465e1b2019-12-16 15:33:39 +053013endif
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050014
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110015LIBFLASH_INSTALL_STAGING = YES
16LIBFLASH_INSTALL_TARGET = YES
17
Stewart Smithb16ba5b2017-01-10 12:55:55 +110018LIBFLASH_LICENSE_FILES = LICENCE
19
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110020LIBFLASH_MAKE_OPTS += CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
21 AS="$(TARGET_AS)" AR="$(TARGET_AR)" NM="$(TARGET_NM)" \
22 OBJCOPY="$(TARGET_OBJCOPY)" OBJDUMP="$(TARGET_OBJDUMP)" \
23 SIZE="$(TARGET_CROSS)size"
24
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100025LIBFLASH_MAKE_ENV = \
26 SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
27 $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS)
28
29
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110030define LIBFLASH_BUILD_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100031 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared
32 $(if $(BR2_PACKAGE_PFLASH),
33 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \
34 -C $(@D)/external/pflash)
Stewart Smith52f2a862018-11-27 13:44:12 +110035 $(if $(BR2_PACKAGE_OPAL_GARD),
36 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \
37 -C $(@D)/external/gard)
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110038endef
39
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050040define HOST_LIBFLASH_BUILD_CMDS
Samuel Mendoza-Jonas70041c52017-08-30 11:01:38 +100041 $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
42 $(MAKE) -C $(@D)/external/pflash
Stewart Smith52f2a862018-11-27 13:44:12 +110043 $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
44 $(MAKE) -C $(@D)/external/gard
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050045endef
46
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110047define LIBFLASH_INSTALL_STAGING_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100048 PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
49 install
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110050endef
51
52define LIBFLASH_INSTALL_TARGET_CMDS
Samuel Mendoza-Jonas70a42c62017-06-20 14:07:50 +100053 PREFIX=$(TARGET_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \
54 install-lib
55 $(if $(BR2_PACKAGE_PFLASH),
56 DESTDIR=$(TARGET_DIR) $(LIBFLASH_MAKE_ENV) \
57 -C $(@D)/external/pflash install)
Stewart Smith52f2a862018-11-27 13:44:12 +110058 $(if $(BR2_PACKAGE_OPAL_GARD),
Stewart Smithacf396d2019-07-08 16:29:18 +100059 $(INSTALL) $(@D)/external/gard/opal-gard $(TARGET_DIR)/usr/bin/opal-gard)
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110060endef
61
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050062define HOST_LIBFLASH_INSTALL_CMDS
63 $(INSTALL) $(@D)/external/pflash/pflash $(HOST_DIR)/usr/bin/pflash
64endef
65
Sam Mendoza-Jonas61bfdf22016-02-10 10:15:24 +110066$(eval $(generic-package))
Charles P. Hofer0ca27df2017-08-10 14:20:00 -050067$(eval $(host-generic-package))