Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # libflash - builds libflash libraries from skiboot source |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Vasant Hegde | 8465e1b | 2019-12-16 15:33:39 +0530 | [diff] [blame] | 7 | ifeq ($(BR2_SKIBOOT_CUSTOM_GIT),y) |
| 8 | LIBFLASH_SITE = $(call qstrip,$(BR2_SKIBOOT_CUSTOM_REPO_URL)) |
| 9 | LIBFLASH_SITE_METHOD = git |
| 10 | else |
| 11 | LIBFLASH_VERSION = $(call qstrip,$(BR2_SKIBOOT_VERSION)) |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 12 | LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION)) |
Vasant Hegde | 8465e1b | 2019-12-16 15:33:39 +0530 | [diff] [blame] | 13 | endif |
Charles P. Hofer | 0ca27df | 2017-08-10 14:20:00 -0500 | [diff] [blame] | 14 | |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 15 | LIBFLASH_INSTALL_STAGING = YES |
| 16 | LIBFLASH_INSTALL_TARGET = YES |
| 17 | |
Stewart Smith | b16ba5b | 2017-01-10 12:55:55 +1100 | [diff] [blame] | 18 | LIBFLASH_LICENSE_FILES = LICENCE |
| 19 | |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 20 | LIBFLASH_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-Jonas | 70a42c6 | 2017-06-20 14:07:50 +1000 | [diff] [blame] | 25 | LIBFLASH_MAKE_ENV = \ |
| 26 | SKIBOOT_VERSION=$(LIBFLASH_VERSION) \ |
| 27 | $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) |
| 28 | |
| 29 | |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 30 | define LIBFLASH_BUILD_CMDS |
Samuel Mendoza-Jonas | 70a42c6 | 2017-06-20 14:07:50 +1000 | [diff] [blame] | 31 | 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 Smith | 52f2a86 | 2018-11-27 13:44:12 +1100 | [diff] [blame] | 35 | $(if $(BR2_PACKAGE_OPAL_GARD), |
| 36 | PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) \ |
| 37 | -C $(@D)/external/gard) |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 38 | endef |
| 39 | |
Charles P. Hofer | 0ca27df | 2017-08-10 14:20:00 -0500 | [diff] [blame] | 40 | define HOST_LIBFLASH_BUILD_CMDS |
Samuel Mendoza-Jonas | 70041c5 | 2017-08-30 11:01:38 +1000 | [diff] [blame] | 41 | $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \ |
| 42 | $(MAKE) -C $(@D)/external/pflash |
Stewart Smith | 52f2a86 | 2018-11-27 13:44:12 +1100 | [diff] [blame] | 43 | $(HOST_MAKE_ENV) SKIBOOT_VERSION=$(LIBFLASH_VERSION) \ |
| 44 | $(MAKE) -C $(@D)/external/gard |
Charles P. Hofer | 0ca27df | 2017-08-10 14:20:00 -0500 | [diff] [blame] | 45 | endef |
| 46 | |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 47 | define LIBFLASH_INSTALL_STAGING_CMDS |
Samuel Mendoza-Jonas | 70a42c6 | 2017-06-20 14:07:50 +1000 | [diff] [blame] | 48 | PREFIX=$(STAGING_DIR)/usr $(LIBFLASH_MAKE_ENV) -C $(@D)/external/shared \ |
| 49 | install |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 50 | endef |
| 51 | |
| 52 | define LIBFLASH_INSTALL_TARGET_CMDS |
Samuel Mendoza-Jonas | 70a42c6 | 2017-06-20 14:07:50 +1000 | [diff] [blame] | 53 | 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 Smith | 52f2a86 | 2018-11-27 13:44:12 +1100 | [diff] [blame] | 58 | $(if $(BR2_PACKAGE_OPAL_GARD), |
Stewart Smith | acf396d | 2019-07-08 16:29:18 +1000 | [diff] [blame] | 59 | $(INSTALL) $(@D)/external/gard/opal-gard $(TARGET_DIR)/usr/bin/opal-gard) |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 60 | endef |
| 61 | |
Charles P. Hofer | 0ca27df | 2017-08-10 14:20:00 -0500 | [diff] [blame] | 62 | define HOST_LIBFLASH_INSTALL_CMDS |
| 63 | $(INSTALL) $(@D)/external/pflash/pflash $(HOST_DIR)/usr/bin/pflash |
| 64 | endef |
| 65 | |
Sam Mendoza-Jonas | 61bfdf2 | 2016-02-10 10:15:24 +1100 | [diff] [blame] | 66 | $(eval $(generic-package)) |
Charles P. Hofer | 0ca27df | 2017-08-10 14:20:00 -0500 | [diff] [blame] | 67 | $(eval $(host-generic-package)) |