From c39f7e521a69b70f5f798acf13e60a0413afc681 Mon Sep 17 00:00:00 2001 From: Greg Solo Date: Wed, 28 Apr 2021 19:49:07 -0400 Subject: [PATCH] Use shell param instead of duplicating the flow --- .vscode/tasks.json | 2 +- Makefile | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 46ab058d50..ba92c20f94 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ { "label": "build", "command": "make", - "args": ["debug"], + "args": ["all", "CONFIGURATION=Debug"], "windows": { "command": "make.cmd" } diff --git a/Makefile b/Makefile index 003889abf0..4d40cb0333 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ RM_F = $(RM) -f RM_RF = $(RM) -rf RUNTIME ?= dotnet +CONFIGURATION ?= Release # Only for use in target version: VERSION := $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || (c=$$(git rev-parse --short HEAD 2>/dev/null) && echo git-$$c)) @@ -75,25 +76,12 @@ endif ##################### DEVELOPMENT BUILDS AND TESTS ##################### # all: + @echo "Compiling in ${CONFIGURATION} mode..." ifeq ($(RUNTIME), mono) @command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 6.4."; exit 1) - @$(MSBUILD) -t:Build -restore -p:Configuration=Release -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true + @$(MSBUILD) -t:Build -restore -p:Configuration=${CONFIGURATION} -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true else - @$(DOTNET) build -c Release -nologo -p:TargetPlatform=$(TARGETPLATFORM) -endif -ifeq ($(TARGETPLATFORM), unix-generic) - @./configure-system-libraries.sh -endif - @./fetch-geoip.sh - -##################### DEVELOPMENT BUILDS AND TESTS (WITH DEBUG) ##################### -# -debug: -ifeq ($(RUNTIME), mono) - @command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 6.4."; exit 1) - @$(MSBUILD) -t:Build -restore -p:Configuration=Release -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -else - @$(DOTNET) build -c Debug -nologo -p:TargetPlatform=$(TARGETPLATFORM) + @$(DOTNET) build -c ${CONFIGURATION} -nologo -p:TargetPlatform=$(TARGETPLATFORM) endif ifeq ($(TARGETPLATFORM), unix-generic) @./configure-system-libraries.sh