Use shell param instead of duplicating the flow
This commit is contained in:
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@@ -4,7 +4,7 @@
|
|||||||
{
|
{
|
||||||
"label": "build",
|
"label": "build",
|
||||||
"command": "make",
|
"command": "make",
|
||||||
"args": ["debug"],
|
"args": ["all", "CONFIGURATION=Debug"],
|
||||||
"windows": {
|
"windows": {
|
||||||
"command": "make.cmd"
|
"command": "make.cmd"
|
||||||
}
|
}
|
||||||
|
|||||||
20
Makefile
20
Makefile
@@ -54,6 +54,7 @@ RM_F = $(RM) -f
|
|||||||
RM_RF = $(RM) -rf
|
RM_RF = $(RM) -rf
|
||||||
|
|
||||||
RUNTIME ?= dotnet
|
RUNTIME ?= dotnet
|
||||||
|
CONFIGURATION ?= Release
|
||||||
# Only for use in target version:
|
# 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))
|
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 #####################
|
##################### DEVELOPMENT BUILDS AND TESTS #####################
|
||||||
#
|
#
|
||||||
all:
|
all:
|
||||||
|
@echo "Compiling in ${CONFIGURATION} mode..."
|
||||||
ifeq ($(RUNTIME), mono)
|
ifeq ($(RUNTIME), mono)
|
||||||
@command -v $(firstword $(MSBUILD)) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 6.4."; exit 1)
|
@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
|
else
|
||||||
@$(DOTNET) build -c Release -nologo -p:TargetPlatform=$(TARGETPLATFORM)
|
@$(DOTNET) build -c ${CONFIGURATION} -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)
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGETPLATFORM), unix-generic)
|
ifeq ($(TARGETPLATFORM), unix-generic)
|
||||||
@./configure-system-libraries.sh
|
@./configure-system-libraries.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user