@@ -57,14 +57,29 @@ $(call check_no_spaces, PACKAGE_NAME)
57
57
# Arguments:
58
58
# - $(1): Pattern matching all arch-specific library files.
59
59
# - $(2): The path to the library.
60
+ # - $(3): The uppercase name of the library.
60
61
define EXTERN_LIB_BUILD_RULE
61
62
62
63
ifneq "$$(wildcard $(2 ) /Makefile.setup) " ""
63
64
# Since a Makefile.setup exists, do any setup steps needed to fetch the library.
65
+
66
+ ifneq "$$(wildcard $(2 ) /Makefile.version) " ""
67
+ # Since a Makefile.version exists, use it to set the necessary dependency.
68
+ include $(2 ) /Makefile.version
69
+
70
+ $$($(3 ) _SENTINEL_FILE) :
71
+ $$(MAKE ) -C $(2 ) -f Makefile.setup all
72
+ $$(MAKE ) -C $(2 ) -f Makefile all
73
+
74
+ $(1 ) : $$($(3 ) _SENTINEL_FILE) ;
75
+ else
76
+ # No Makefile.version, so this will work the first time the library is built.
64
77
$(1 ) :
65
78
$$(MAKE ) -C $(2 ) -f Makefile.setup all
66
79
$$(MAKE ) -C $(2 ) -f Makefile all
80
+ endif
67
81
else
82
+ # No setup needed, just build the library the first time.
68
83
$(1 ) :
69
84
$$(MAKE ) -C $(2 ) -f Makefile all
70
85
endif
@@ -90,8 +105,8 @@ $$(notdir $(1))_BUILDDIR ?= $(1)/build
90
105
$$(foreach arch, $$(TOCK_ARCHS ) , $$(eval LIBS_$$(arch ) += $$($(notdir $(1 ) ) _BUILDDIR) /$$(arch ) /$(notdir $(1 ) ) .a) )
91
106
92
107
# Generate rule for building the library.
93
- # $$(info $$(call EXTERN_LIB_BUILD_RULE,$$(foreach arch,$$(TOCK_ARCHS),%/$$(arch)/$(notdir $(1)).a),$(1)))
94
- $$(eval $$(call EXTERN_LIB_BUILD_RULE,$$(foreach arch,$$(TOCK_ARCHS ) ,% /$$(arch ) /$(notdir $(1 ) ) .a) ,$(1 ) ) )
108
+ # $$(info $$(call EXTERN_LIB_BUILD_RULE,$$(foreach arch,$$(TOCK_ARCHS),%/$$(arch)/$(notdir $(1)).a),$(1),$(shell echo '$(notdir $(1))' | tr '[:lower:]' '[:upper:]') ))
109
+ $$(eval $$(call EXTERN_LIB_BUILD_RULE,$$(foreach arch,$$(TOCK_ARCHS ) ,% /$$(arch ) /$(notdir $(1 ) ) .a) ,$(1 ) , $( shell echo ' $( notdir $( 1 ) ) ' | tr '[:lower:]' '[:upper:]') ) )
95
110
96
111
endef
97
112
0 commit comments