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