-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.prop.mk
71 lines (55 loc) · 2.34 KB
/
build.prop.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# build.prop.mk
# the default board prop
sub_space := \#
################# buildprop ############################
$(foreach property,$(BOARD_PROPERTY_FOLLOW_BASE),\
$(eval propValue := $(shell $(call getprop,$(property),$(BOARD_SYSTEM)/build.prop))) \
$(if $(propValue),\
$(eval BOARD_PROPERTY_OVERRIDES := $(filter-out $(property)=%,$(BOARD_PROPERTY_OVERRIDES))) \
$(eval BOARD_PROPERTY_OVERRIDES += $(property)=$(propValue)) \
) \
)
BOARD_PROPERTY_OVERRIDES := \
$(call collapse-pairs, $(BOARD_PROPERTY_OVERRIDES))
PROPERTY_REMOVE := $(remove_property)
PROPERTY_OVERRIDES := \
$(strip $(override_property) $(BOARD_PROPERTY_OVERRIDES))
PROPERTY_OVERRIDES := \
$(subst $(space),$(sub_space),$(PROPERTY_OVERRIDES))
PROPERTY_OVERRIDES := \
$(subst $(sub_space)=,=,$(PROPERTY_OVERRIDES))
PROPERTY_OVERRIDES := \
$(subst =$(sub_space),=,$(PROPERTY_OVERRIDES))
PROPERTY_OVERRIDES := \
$(shell echo '$(PROPERTY_OVERRIDES)' | sed -e "s/$(sub_space)\([^$(sub_space)]*\=\)/ \1/g")
PROPERTY_OVERRIDES := \
$(call uniq-pairs-by-first-component,$(PROPERTY_OVERRIDES),=)
$(OUT_OBJ_SYSTEM)/board.build.prop: $(BOARD_SYSTEM)/build.prop $(PRJ_MAKEFILE)
$(hide) echo ">> overries properties ..."
$(hide) mkdir -p $(OUT_OBJ_SYSTEM)
$(hide) $(foreach line,$(PROPERTY_OVERRIDES), \
echo "$(line)" | sed 's/$(sub_space)/ /g' >> $@;)
$(hide) $(foreach line,$(PROPERTY_REMOVE), \
echo "$(line)=delete" >> $@;)
$(hide) echo "<< overries properties done"
.PHONY: build_prop
TARGET_FILES_SYSTEM += $(OUT_SYSTEM)/build.prop
#$(info # VERSION_NUMBER: $(VERSION_NUMBER))
build_prop $(OUT_SYSTEM)/build.prop: $(OUT_OBJ_SYSTEM)/board.build.prop
build_prop $(OUT_SYSTEM)/build.prop: $(VENDOR_BUILD_PROP)
$(hide) echo ">> make build.prop, with version number: $(VERSION_NUMBER)"
$(hide) mkdir -p $(OUT_SYSTEM)
$(hide) $(MAKE_BUILD_PROP) \
-b $(OUT_OBJ_SYSTEM)/board.build.prop \
-r $(VENDOR_BUILD_PROP) \
-o $(OUT_SYSTEM)/build.prop
$(hide) if [ -x $(PRJ_CUSTOM_BUILDPROP) ];then \
$(PRJ_CUSTOM_BUILDPROP) $(OUT_SYSTEM)/build.prop; \
fi;
$(hide) echo "<< make build.prop, with version number done.";
$(hide) echo "* build.prop out ==> $(OUT_SYSTEM)/build.prop"
$(hide) echo " "
.PHONY: clean-build_prop
clean-build_prop:
$(hide) rm -rf $(OUT_SYSTEM)/build.prop
$(hide) rm -rf $(OUT_OBJ_SYSTEM)/board.build.prop