Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (50 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
59 lines (50 loc) · 1.5 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PROJECT := FLStudioRPC.csproj
CONFIG ?= Release
RID ?= linux-x64
BUILD_DIR := build
PUBLISH_DIR := $(BUILD_DIR)/publish/$(RID)
.PHONY: all help restore build publish package clean
all: build
help:
@echo "FL Studio Linux RPC"
@echo ""
@echo "Available targets:"
@echo " make Build the project"
@echo " make restore Restore .NET dependencies"
@echo " make build Build the project"
@echo " make publish Create a self-contained Linux build"
@echo " make package VERSION=X.Y.Z Build DEB, RPM and Arch packages"
@echo " make clean Remove generated build files"
@echo ""
@echo "Variables:"
@echo " CONFIG=Release Build configuration"
@echo " RID=linux-x64 .NET runtime identifier"
@echo ""
@echo "Examples:"
@echo " make publish"
@echo " make publish RID=linux-arm64"
@echo " make package VERSION=1.3.0"
restore:
dotnet restore $(PROJECT)
build: restore
dotnet build $(PROJECT) \
-c $(CONFIG) \
--no-restore
publish: restore
mkdir -p "$(PUBLISH_DIR)"
dotnet publish $(PROJECT) \
-c $(CONFIG) \
-r $(RID) \
--self-contained true \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishDir="$(CURDIR)/$(PUBLISH_DIR)/"
package:
ifndef VERSION
$(error VERSION is required. Example: make package VERSION=1.3.0)
endif
./packaging/build-packages.sh $(VERSION)
clean:
rm -rf "$(BUILD_DIR)"
rm -rf dist
dotnet clean $(PROJECT) -c $(CONFIG)