summaryrefslogtreecommitdiffstats
path: root/include/image-legacy.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-19 12:38:02 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-20 10:13:50 +0200
commitebd0b2d0b10a36b35a245c6217f372d0fa886686 (patch)
treea5eb01b39b9c126199751be9ff86175a1d4a603c /include/image-legacy.mk
parentd7b185128d8506d4844931094c9bc2d011ec006f (diff)
downloadmaster-31e0f0ae-ebd0b2d0b10a36b35a245c6217f372d0fa886686.tar.gz
master-31e0f0ae-ebd0b2d0b10a36b35a245c6217f372d0fa886686.tar.bz2
master-31e0f0ae-ebd0b2d0b10a36b35a245c6217f372d0fa886686.zip
build: split legacy image building code out of image.mk
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/image-legacy.mk')
-rw-r--r--include/image-legacy.mk39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/image-legacy.mk b/include/image-legacy.mk
new file mode 100644
index 0000000000..3acf2b9760
--- /dev/null
+++ b/include/image-legacy.mk
@@ -0,0 +1,39 @@
+LegacyDevice/Dump = $(Device/Dump)
+
+define LegacyDevice/Check
+ _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
+ _TARGET_PREPARE := $$(if $$(_PROFILE_SET),legacy-images-prepare,prepare-disabled)
+ _TARGET := $$(if $$(_PROFILE_SET),legacy-images,install-disabled)
+ $$(if $$(_PROFILE_SET),install: legacy-images-make)
+ ifndef IB
+ $$(if $$(_PROFILE_SET),mkfs_prepare: legacy-images-prepare-make)
+ endif
+endef
+
+define LegacyDevice/Build
+ $$(_TARGET): legacy-image-$(1)
+ $$(_TARGET_PREPARE): legacy-image-prepare-$(1)
+ .PHONY: legacy-image-prepare-$(1) legacy-image-$(1)
+
+ legacy-image-prepare-$(1):
+ $$(call Image/Prepare/Profile,$(1))
+
+ legacy-image-$(1):
+ $$(call Image/BuildKernel/Profile,$(1))
+ $(foreach fs,$(TARGET_FILESYSTEMS),
+ $$(call Image/Build/Profile,$(1),$(fs))
+ )
+
+endef
+
+define LegacyDevice
+ $(call Device/InitProfile,$(1))
+ $(call Device/Default,$(1))
+ $(call LegacyDevice/Default,$(1))
+ $(call LegacyDevice/$(1),$(1))
+ $(call LegacyDevice/Check,$(1))
+ $(call LegacyDevice/$(if $(DUMP),Dump,Build),$(1))
+
+endef
+
+