-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (31 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Below is a workaround for .NET SDK 7.0 trying to allocate large amounts of memory for GC work:
# https://github.com/dotnet/runtime/issues/85556#issuecomment-1529177092
DOTNET_HEAP_LIMIT_INT = $(shell sysctl -n hw.memsize 2>/dev/null || grep MemAvailable /proc/meminfo | awk '{print $$2 * 1024}')
DOTNET_HEAP_LIMIT = $(shell printf '%X\n' $(DOTNET_HEAP_LIMIT_INT))
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
OUTPUTS := \
-name "bin" -or \
-name "obj"
.PHONY: all
# General use
all: all-online
all-online: invoke-build
dbg:
$(MAKE) invoke-build ENVIRONMENT=Debug
dbg-ci:
$(MAKE) invoke-build-ci ENVIRONMENT=Debug
rel-ci:
$(MAKE) invoke-build-ci ENVIRONMENT=Release
doc: invoke-doc-build
clean:
find $(ROOT_DIR) -type d \( $(OUTPUTS) \) -print -exec rm -rf {} +
# Below targets specify functions for full build
invoke-build:
chmod +x ./tools/build.sh
./tools/build.sh "$(ENVIRONMENT)" || (echo Retrying with heap limit 0x$(DOTNET_HEAP_LIMIT)... && DOTNET_GCHeapHardLimit=$(DOTNET_HEAP_LIMIT) ./tools/build.sh "$(ENVIRONMENT)")
invoke-build-ci:
chmod +x ./tools/build.sh
./tools/build.sh "$(ENVIRONMENT)" -p:ContinuousIntegrationBuild=true || (echo Retrying with heap limit 0x$(DOTNET_HEAP_LIMIT)... && DOTNET_GCHeapHardLimit=$(DOTNET_HEAP_LIMIT) ./tools/build.sh "$(ENVIRONMENT)" -p:ContinuousIntegrationBuild=true)
invoke-doc-build:
chmod +x ./tools/docgen.sh
./tools/docgen.sh || (echo Retrying with heap limit 0x$(DOTNET_HEAP_LIMIT)... && DOTNET_GCHeapHardLimit=$(DOTNET_HEAP_LIMIT) ./tools/docgen.sh)