diff --git a/Makefile b/Makefile index 40014e2..e7d0ada 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ WHITELISTED_MOD_ASSEMBLIES = "$(shell cat user.config mod.config 2> /dev/null | MANIFEST_PATH = "mods/$(MOD_ID)/mod.yaml" HAS_LUAC = $(shell command -v luac 2> /dev/null) LUA_FILES = $(shell find mods/*/maps/* -iname '*.lua' 2> /dev/null) +MOD_SOLUTION_FILES = $(shell find . -maxdepth 1 -iname '*.sln' 2> /dev/null) MSBUILD = msbuild -verbosity:m -nologo @@ -114,6 +115,7 @@ utility: engine-dependencies engine core: @command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1) +ifneq ("$(MOD_SOLUTION_FILES)","") @find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:restore \; ifeq ($(WIN32), $(filter $(WIN32),true yes y on 1)) @find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:build -p:Configuration="Release-x86" \; @@ -121,12 +123,15 @@ else @$(MSBUILD) -t:build -p:Configuration=Release @find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:build -p:Configuration=Release \; endif +endif all: engine-dependencies engine core clean: engine @command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1) +ifneq ("$(MOD_SOLUTION_FILES)","") @find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:clean \; +endif @cd $(ENGINE_DIRECTORY) && make clean @printf "The engine has been cleaned.\n" @@ -147,8 +152,10 @@ ifneq ("$(LUA_FILES)","") endif check: utility +ifneq ("$(MOD_SOLUTION_FILES)","") @echo "Compiling in debug mode..." @$(MSBUILD) -t:build -p:Configuration=Debug +endif @echo "Checking runtime assemblies..." @MOD_SEARCH_PATHS="$(MOD_SEARCH_PATHS)" mono --debug "$(ENGINE_DIRECTORY)/OpenRA.Utility.exe" $(MOD_ID) --check-runtime-assemblies $(WHITELISTED_OPENRA_ASSEMBLIES) $(WHITELISTED_THIRDPARTY_ASSEMBLIES) $(WHITELISTED_CORE_ASSEMBLIES) $(WHITELISTED_MOD_ASSEMBLIES) @echo "Checking for explicit interface violations..."