Unfold the result of output-kernel

The number of file kernel versions and output files are not reduced.
We don't need output-kernel now.

Bug: 230047219
Test: TH with gki_arm64 and gki_x86_64
Change-Id: I7d74595dce9e398990ea08ed805ce0bb81df7f97
(cherry picked from commit ceb6b290af57b33217128c93325303a84ec77c64)
diff --git a/gki_arm64.mk b/gki_arm64.mk
index ede3001..3ff21cd 100644
--- a/gki_arm64.mk
+++ b/gki_arm64.mk
@@ -24,9 +24,39 @@
 # Build GKI boot images
 #
 include device/generic/common/gki_common.mk
-$(call output-kernel,kernel/prebuilts/4.19/arm64,kernel/4.19)
-$(call output-kernel,kernel/prebuilts/5.10/arm64,kernel/5.10)
-$(call output-kernel,kernel/prebuilts/5.15/arm64,kernel/5.15)
+
+PRODUCT_COPY_FILES += \
+    kernel/prebuilts/4.19/arm64/kernel-4.19:kernel-4.19 \
+    kernel/prebuilts/4.19/arm64/kernel-4.19-gz:kernel-4.19-gz \
+    kernel/prebuilts/4.19/arm64/kernel-4.19-lz4:kernel-4.19-lz4 \
+    kernel/prebuilts/5.10/arm64/kernel-5.10:kernel-5.10 \
+    kernel/prebuilts/5.10/arm64/kernel-5.10-gz:kernel-5.10-gz \
+    kernel/prebuilts/5.10/arm64/kernel-5.10-lz4:kernel-5.10-lz4 \
+    kernel/prebuilts/5.15/arm64/kernel-5.15:kernel-5.15 \
+    kernel/prebuilts/5.15/arm64/kernel-5.15-gz:kernel-5.15-gz \
+    kernel/prebuilts/5.15/arm64/kernel-5.15-lz4:kernel-5.15-lz4 \
+
+$(call dist-for-goals,dist_files,kernel/prebuilts/4.19/arm64/prebuilt-info.txt:kernel/4.19/prebuilt-info.txt)
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.10/arm64/prebuilt-info.txt:kernel/5.10/prebuilt-info.txt)
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.15/arm64/prebuilt-info.txt:kernel/5.15/prebuilt-info.txt)
+
+ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
+PRODUCT_COPY_FILES += \
+    kernel/prebuilts/4.19/arm64/kernel-4.19-allsyms:kernel-4.19-allsyms \
+    kernel/prebuilts/4.19/arm64/kernel-4.19-gz-allsyms:kernel-4.19-gz-allsyms \
+    kernel/prebuilts/4.19/arm64/kernel-4.19-lz4-allsyms:kernel-4.19-lz4-allsyms \
+    kernel/prebuilts/5.10/arm64/kernel-5.10-allsyms:kernel-5.10-allsyms \
+    kernel/prebuilts/5.10/arm64/kernel-5.10-gz-allsyms:kernel-5.10-gz-allsyms \
+    kernel/prebuilts/5.10/arm64/kernel-5.10-lz4-allsyms:kernel-5.10-lz4-allsyms \
+    kernel/prebuilts/5.15/arm64/kernel-5.15-allsyms:kernel-5.15-allsyms \
+    kernel/prebuilts/5.15/arm64/kernel-5.15-gz-allsyms:kernel-5.15-gz-allsyms \
+    kernel/prebuilts/5.15/arm64/kernel-5.15-lz4-allsyms:kernel-5.15-lz4-allsyms \
+
+$(call dist-for-goals,dist_files,kernel/prebuilts/4.19/arm64/prebuilt-info.txt:kernel/4.19-debug/prebuilt-info.txt)
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.10/arm64/prebuilt-info.txt:kernel/5.10-debug/prebuilt-info.txt)
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.15/arm64/prebuilt-info.txt:kernel/5.15-debug/prebuilt-info.txt)
+
+endif
 
 
 PRODUCT_NAME := gki_arm64
diff --git a/gki_common.mk b/gki_common.mk
index 1d301c0..42b9a6c 100644
--- a/gki_common.mk
+++ b/gki_common.mk
@@ -14,74 +14,6 @@
 # limitations under the License.
 #
 
-# The files will be copy from the source folder to the dist folder
-_output-kernel-info-files := \
-    prebuilt-info.txt \
-    manifest.xml \
-
-
-# Copy the files from the source folder to the dist folder
-#
-# Skip if the file is not existing.
-#
-# $(1): file list
-# $(2): the source folder
-# $(3): the dist folder
-define _output_kernel_files
-$(foreach f,$(1), \
-  $(if $(wildcard $(2)/$(f)), \
-    $(call dist-for-goals,dist_files,$(2)/$(f):$(3)/$(f))))
-endef
-
-
-# Output the release kernel prebuilt files to dist folder
-#
-# $(1): the source folder contains the kernel prebuilt files
-#
-# Notes:
-#   For mainline kernel, it outputs -allsyms kernel as release kernel.
-#
-define _output-kernel-user
-$(if $(findstring mainline,$(1)), \
-  $(eval PRODUCT_COPY_FILES += \
-    $(foreach f,$(wildcard $(1)/kernel-*-allsyms), \
-      $(f):$(subst -allsyms,,$(notdir $(f))))), \
-  $(eval PRODUCT_COPY_FILES += \
-    $(call copy-files,$(filter-out *-allsyms,$(wildcard $(1)/kernel-*)),.)))
-endef
-
-
-# Output the debug kernel prebuilt files to dist folder
-#
-# $(1): the source folder contains the kernel prebuilt files
-#
-# Note:
-#   For mainline kernel, it outputs -allsyms kernel as release kernel,
-#   so there is no need to output -allsyms again.
-#
-define _output-kernel-debug
-$(if $(findstring mainline,$(1)),, \
-  $(eval PRODUCT_COPY_FILES += \
-    $(call copy-files,$(wildcard $(1)/kernel-*-allsyms),.)))
-endef
-
-
-# Output the kernel prebuilt files to dist folder
-#
-# $(1): the source folder contains the kernel prebuilt files
-# $(2): the dist folder
-#
-# Example:
-#  $(call output-kernel,kernel/prebuilts/5.10/arm64,kernel/5.10)
-#
-define output-kernel
-$(call _output-kernel-user,$(1))
-$(call _output_kernel_files,$(_output-kernel-info-files),$(1),$(2))
-$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)), \
-  $(call _output-kernel-debug,$(1)) \
-  $(call _output_kernel_files,$(_output-kernel-info-files),$(1),$(2)-debug))
-endef
-
 #
 # Output boot.img
 #
diff --git a/gki_x86_64.mk b/gki_x86_64.mk
index 75f5ff7..2dc7919 100644
--- a/gki_x86_64.mk
+++ b/gki_x86_64.mk
@@ -24,8 +24,24 @@
 # Build GKI boot images
 #
 include device/generic/common/gki_common.mk
-$(call output-kernel,kernel/prebuilts/5.10/x86_64,kernel/5.10)
-$(call output-kernel,kernel/prebuilts/5.15/x86_64,kernel/5.15)
+
+PRODUCT_COPY_FILES += \
+    kernel/prebuilts/5.10/x86_64/kernel-5.10:kernel-5.10 \
+    kernel/prebuilts/5.15/x86_64/kernel-5.15:kernel-5.15 \
+
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.10/x86_64/prebuilt-info.txt:kernel/5.10/prebuilt-info.txt)
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.15/x86_64/prebuilt-info.txt:kernel/5.15/prebuilt-info.txt)
+
+ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
+
+PRODUCT_COPY_FILES += \
+    kernel/prebuilts/5.10/x86_64/kernel-5.10-allsyms:kernel-5.10-allsyms \
+    kernel/prebuilts/5.15/x86_64/kernel-5.15-allsyms:kernel-5.15-allsyms \
+
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.10/x86_64/prebuilt-info.txt:kernel/5.10-debug/prebuilt-info.txt)
+$(call dist-for-goals,dist_files,kernel/prebuilts/5.15/x86_64/prebuilt-info.txt:kernel/5.15-debug/prebuilt-info.txt)
+
+endif
 
 
 PRODUCT_NAME := gki_x86_64