pflash: Refactor recipe

Move pflash to a general skiboot recipe so that we can create
additional recipes for other components of skiboot.

Change-Id: I59253d17840da7a07f00bec9c650676da9ffb5e5
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pflash/pflash.bb b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pflash/pflash.bb
deleted file mode 100644
index 05240ed..0000000
--- a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pflash/pflash.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "pflash programmer for OpenPower"
-DESCRIPTION = "pflash firmware programming tool for OpenPower machines"
-HOMEPAGE = "https://github.com/open-power"
-LICENSE = "Apache-2.0"
-
-SRC_URI += "git://github.com/open-power/skiboot.git"
-
-LIC_FILES_CHKSUM = "file://${S}/LICENCE;md5=3b83ef96387f14655fc854ddc3c6bd57"
-
-SRCREV = "skiboot-5.3.0"
-PV = "5.3.0"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} SKIBOOT_VERSION=${PV} PFLASH_VERSION=${PV} V=1'
-
-do_compile () {
-        oe_runmake -C external/pflash all LINKAGE=dynamic
-}
-
-do_install () {
-        oe_runmake -C external/pflash install LINKAGE=dynamic DESTDIR=${D} PREFIX=${D}/usr
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/pflash.bb b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/pflash.bb
new file mode 100644
index 0000000..7085266
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/pflash.bb
@@ -0,0 +1,5 @@
+SUMMARY = "pflash programmer for OpenPower"
+DESCRIPTION = "pflash firmware programming tool for OpenPower machines"
+
+require skiboot.inc
+EXTRA_OEMAKE_append = " PFLASH_VERSION=${PV} LINKAGE=dynamic"
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc
new file mode 100644
index 0000000..757d63d
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc
@@ -0,0 +1,25 @@
+HOMEPAGE = "https://github.com/open-power"
+LICENSE = "Apache-2.0"
+
+SRC_URI += "git://github.com/open-power/skiboot.git"
+
+LIC_FILES_CHKSUM = "file://${S}/LICENCE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRCREV = "skiboot-5.3.0"
+PV = "5.3.0"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} SKIBOOT_VERSION=${PV} V=1"
+
+SKIBOOT_SUBDIR ?= "external/${PN}"
+
+do_compile() {
+    oe_runmake -C ${SKIBOOT_SUBDIR} all
+}
+
+do_install() {
+    oe_runmake -C ${SKIBOOT_SUBDIR} install DESTDIR=${D} PREFIX=${D}/usr
+}
+
+BBCLASSEXTEND = "native nativesdk"