Skip to content

Commit faaa908

Browse files
luhenryjonpryor
authored andcommitted
[build] Remove unnecessary $(CONFIGURATION) use (dotnet#2353)
Commit ae093bf removed all uses of `$(CONFIGURATIONS)`, replacing `$(foreach conf, $(CONFIGURATIONS))` with `$(CONFIGURATION)`. This works, but results in Makefile fragments which are more complicated than necessary, and `$(call)` invocations which needlessly pass `$(CONFIGURATION)` when the make `define` could directly use `$(CONFIGURATION)` instead. Remove unnecessary uses of `$(CONFIGURATION)`, simplifying the rules.
1 parent d0e86e8 commit faaa908

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

Makefile

+13-13
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ $(XA_BUILD_PATHS_OUT): bin/Test%/XABuildPaths.cs: build-tools/scripts/XABuildPat
150150
cat $@
151151

152152

153-
# Usage: $(call CALL_CREATE_THIRD_PARTY_NOTICES,configuration,path,licenseType,includeExternalDeps,includeBuildDeps)
153+
# Usage: $(call CALL_CREATE_THIRD_PARTY_NOTICES,path,licenseType,includeExternalDeps,includeBuildDeps)
154154
define CREATE_THIRD_PARTY_NOTICES
155-
$(call MSBUILD_BINLOG,create-tpn,$(MSBUILD),$(1)) $(_MSBUILD_ARGS) \
155+
$(call MSBUILD_BINLOG,create-tpn,$(MSBUILD)) $(_MSBUILD_ARGS) \
156156
$(topdir)/build-tools/ThirdPartyNotices/ThirdPartyNotices.csproj \
157-
/p:Configuration=$(1) \
158-
/p:ThirdPartyNoticeFile=$(topdir)/$(2) \
159-
/p:ThirdPartyNoticeLicenseType=$(3) \
160-
/p:TpnIncludeExternalDependencies=$(4) \
161-
/p:TpnIncludeBuildDependencies=$(5)
157+
/p:Configuration=$(CONFIGURATION) \
158+
/p:ThirdPartyNoticeFile=$(topdir)/$(1) \
159+
/p:ThirdPartyNoticeLicenseType=$(2) \
160+
/p:TpnIncludeExternalDependencies=$(3) \
161+
/p:TpnIncludeBuildDependencies=$(4)
162162
endef # CREATE_THIRD_PARTY_NOTICES
163163

164164
prepare:: prepare-tpn
@@ -167,20 +167,20 @@ TPN_LICENSE_FILES = $(shell grep -h '<LicenseFile>' external/*.tpnitems src/*.tp
167167
| sed -E 's,<LicenseFile>(.*)</LicenseFile>,\1,g;s,.\(MSBuildThisFileDirectory\),$(topdir)/external/,g' \
168168
| tr \\ / )
169169

170-
# Usage: $(call CREATE_THIRD_PARTY_NOTICES,configuration,path,licenseType,includeExternalDeps,includeBuildDeps)
170+
# Usage: $(call CREATE_THIRD_PARTY_NOTICES_RULE,path,licenseType,includeExternalDeps,includeBuildDeps)
171171
define CREATE_THIRD_PARTY_NOTICES_RULE
172-
prepare-tpn:: $(2)
172+
prepare-tpn:: $(1)
173173

174-
$(2) $(topdir)/$(2): build-tools/ThirdPartyNotices/ThirdPartyNotices.csproj \
174+
$(1) $(topdir)/$(1): build-tools/ThirdPartyNotices/ThirdPartyNotices.csproj \
175175
$(wildcard external/*.tpnitems src/*.tpnitems) \
176176
$(TPN_LICENSE_FILES)
177-
$(call CREATE_THIRD_PARTY_NOTICES,$(1),$(2),$(3),$(4),$(5))
177+
$(call CREATE_THIRD_PARTY_NOTICES,$(1),$(2),$(3),$(4))
178178
endef # CREATE_THIRD_PARTY_NOTICES_RULE
179179

180180
THIRD_PARTY_NOTICE_LICENSE_TYPE = microsoft-oss
181181

182-
$(eval $(call CREATE_THIRD_PARTY_NOTICES_RULE,$(CONFIGURATION),ThirdPartyNotices.txt,foundation,False,False))
183-
$(eval $(call CREATE_THIRD_PARTY_NOTICES_RULE,$(CONFIGURATION),bin/$(CONFIGURATION)/lib/xamarin.android/ThirdPartyNotices.txt,$(THIRD_PARTY_NOTICE_LICENSE_TYPE),True,False))
182+
$(eval $(call CREATE_THIRD_PARTY_NOTICES_RULE,ThirdPartyNotices.txt,foundation,False,False))
183+
$(eval $(call CREATE_THIRD_PARTY_NOTICES_RULE,bin/$(CONFIGURATION)/lib/xamarin.android/ThirdPartyNotices.txt,$(THIRD_PARTY_NOTICE_LICENSE_TYPE),True,False))
184184

185185
run-all-tests:
186186
$(call MSBUILD_BINLOG,run-all-tests) $(TEST_TARGETS) /t:RunAllTests

build-tools/scripts/BuildEverything.mk

+7-7
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ jenkins: prepare leeroy $(ZIP_OUTPUT)
8888
leeroy: leeroy-all framework-assemblies opentk-jcw
8989

9090
leeroy-all:
91-
$(call MSBUILD_BINLOG,leeroy-all,$(_SLN_BUILD),$(CONFIGURATION)) $(SOLUTION) /p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) && \
92-
$(call CREATE_THIRD_PARTY_NOTICES,$(CONFIGURATION),bin/$(CONFIGURATION)/lib/xamarin.android/ThirdPartyNotices.txt,$(THIRD_PARTY_NOTICE_LICENSE_TYPE),True,False)
91+
$(call MSBUILD_BINLOG,leeroy-all,$(_SLN_BUILD)) $(SOLUTION) /p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) && \
92+
$(call CREATE_THIRD_PARTY_NOTICES,bin/$(CONFIGURATION)/lib/xamarin.android/ThirdPartyNotices.txt,$(THIRD_PARTY_NOTICE_LICENSE_TYPE),True,False)
9393

9494
framework-assemblies:
9595
PREV_VERSION="v1.0"; \
@@ -100,31 +100,31 @@ framework-assemblies:
100100
if [ $$? -ne 0 ] ; then \
101101
rm -f bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
102102
fi; \
103-
$(call MSBUILD_BINLOG,Mono.Android,$(_SLN_BUILD),$(CONFIGURATION)) src/Mono.Android/Mono.Android.csproj \
103+
$(call MSBUILD_BINLOG,Mono.Android,$(_SLN_BUILD)) src/Mono.Android/Mono.Android.csproj \
104104
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
105105
/p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$${CUR_VERSION} \
106106
/p:AndroidPreviousFrameworkVersion=$${PREV_VERSION} || exit 1; \
107107
PREV_VERSION=$${CUR_VERSION}; )
108108
rm -f bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \
109-
$(call MSBUILD_BINLOG,NUnitLite,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
109+
$(call MSBUILD_BINLOG,NUnitLite,$(_SLN_BUILD)) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj \
110110
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
111111
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
112112
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1;
113113
_latest_stable_framework=$$($(MSBUILD) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:GetAndroidLatestStableFrameworkVersion build-tools/scripts/Info.targets | tr -d '[[:space:]]') ; \
114114
rm -f "bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/Mono.Android.Export.* ; \
115-
$(call MSBUILD_BINLOG,Mono.Android.Export,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/Mono.Android.Export/Mono.Android.Export.csproj \
115+
$(call MSBUILD_BINLOG,Mono.Android.Export,$(_SLN_BUILD)) $(MSBUILD_FLAGS) src/Mono.Android.Export/Mono.Android.Export.csproj \
116116
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
117117
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
118118
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1; \
119119
rm -f "bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/$$_latest_stable_framework"/OpenTK-1.0.* ; \
120-
$(call MSBUILD_BINLOG,OpenTK,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
120+
$(call MSBUILD_BINLOG,OpenTK,$(_SLN_BUILD)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
121121
/p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
122122
/p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidPlatformId=$(word $(firstword $(API_LEVELS)), $(ALL_PLATFORM_IDS)) \
123123
/p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)) || exit 1;
124124

125125
opentk-jcw:
126126
$(foreach a, $(API_LEVELS), \
127127
touch bin/$(CONFIGURATION)/lib/xamarin.android/xbuild-frameworks/MonoAndroid/*/OpenTK-1.0.dll; \
128-
$(call MSBUILD_BINLOG,OpenTK-JCW,$(_SLN_BUILD),$(CONFIGURATION)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
128+
$(call MSBUILD_BINLOG,OpenTK-JCW,$(_SLN_BUILD)) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj \
129129
/t:GenerateJavaCallableWrappers /p:Configuration=$(CONFIGURATION) $(_MSBUILD_ARGS) \
130130
/p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)) || exit 1; )

build-tools/scripts/msbuild.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ endif # $(MSBUILD) == msbuild
3737

3838
ifeq ($(USE_MSBUILD),1)
3939

40-
# $(call MSBUILD_BINLOG,name,msbuild=$(MSBUILD),conf=$(CONFIGURATION))
40+
# $(call MSBUILD_BINLOG,name,msbuild=$(MSBUILD))
4141
define MSBUILD_BINLOG
4242
$(if $(2),$(2),$(MSBUILD)) $(MSBUILD_FLAGS) /v:normal \
43-
/binaryLogger:"$(dir $(realpath $(firstword $(MAKEFILE_LIST))))/bin/Build$(if $(3),$(3),$(CONFIGURATION))/msbuild-`date +%Y%m%dT%H%M%S`-$(1).binlog"
43+
/binaryLogger:"$(dir $(realpath $(firstword $(MAKEFILE_LIST))))/bin/Build$(CONFIGURATION)/msbuild-`date +%Y%m%dT%H%M%S`-$(1).binlog"
4444
endef
4545

4646
else # $(MSBUILD) != 1
@@ -55,7 +55,7 @@ ifneq ($(V),0)
5555
MSBUILD_FLAGS += /v:diag
5656
endif # $(V) != 0
5757

58-
# $(call MSBUILD_BINLOG,name,msbuild=$(MSBUILD),conf=$(CONFIGURATION))
58+
# $(call MSBUILD_BINLOG,name,msbuild=$(MSBUILD))
5959
define MSBUILD_BINLOG
6060
$(if $(2),$(2),$(MSBUILD)) $(MSBUILD_FLAGS)
6161
endef

0 commit comments

Comments
 (0)