Allow duplicate release config maps and build flag declarations

Only include a release_config_map.mk file the first time it appears in
the list.

If the flag declaration is identical to one already declared, do not
raise an error.

This eases the process of migrating where flags are declared.

Bug: b/328781415
Bug: b/328495189
Test: manual, TH
Change-Id: I18316e769438f62071723771762d6e89be98b813
Merged-In: I18316e769438f62071723771762d6e89be98b813
diff --git a/core/release_config.mk b/core/release_config.mk
index a6152bd..36882bb 100644
--- a/core/release_config.mk
+++ b/core/release_config.mk
@@ -119,12 +119,17 @@
 endef
 
 # Include the config map files and populate _flag_declaration_files.
+# If the file is found more than once, only include it the first time.
 _flag_declaration_files :=
+_included_config_map_files :=
 $(foreach f, $(config_map_files), \
     $(eval FLAG_DECLARATION_FILES:= ) \
-    $(eval _included := $(f)) \
-    $(eval include $(f)) \
-    $(eval _flag_declaration_files += $(FLAG_DECLARATION_FILES)) \
+    $(if $(filter $(_included_config_map_files),$(f)),,\
+        $(eval _included := $(f)) \
+        $(eval include $(f)) \
+        $(eval _flag_declaration_files += $(FLAG_DECLARATION_FILES)) \
+        $(eval _included_config_map_files += $(f)) \
+    ) \
 )
 FLAG_DECLARATION_FILES :=