-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (54 loc) · 1.86 KB
/
Copy pathMakefile
File metadata and controls
65 lines (54 loc) · 1.86 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
60
61
62
63
64
65
#
# This simple makefile just kickstarts MSBuild system
# for actual build details refer to *.csproj files
#
# Build SDK: 8.0
# Target SDK: 6.0
#
# - Building using SDK 8.0 so that generated PE32 executables contain resources section
# - UI target currently supports only Windows
# - CLI target supports Linux (project for debugging)
#
# Usage examples:
# 'make' or 'make all' : builds all targets (currently ui and cli)
# 'make ARCH=x86 CONFIG=Release' : builds all targets into 32-bit windows executable with optimizations
# 'make AGSUnpacker.CLI TARGET=linux' : build CLI and its dependencies for debugging targeting linux
# 'make publish CONFIG=Release' : use this to publish releases
#
DOTNET ?= dotnet
RM ?= rm
TARGET ?= win
ARCH ?= x64
CONFIG ?= Debug
VERSION ?= 0.10
AUTHORS ?= Unknown
PUBLIC_RELEASE ?=
BUILD_DIR ?= build/
BUILD_ARTIFACTS ?= $(BUILD_DIR)artifacts/
BUILD_OUTPUT ?= $(BUILD_DIR)
BUILD_PUBLISH ?= $(BUILD_DIR)package/
BUILD_OPTIONS = --os $(TARGET) -a $(ARCH) -c $(CONFIG)
# 'artifacts-path' not available on .net 6
# BUILD_OPTIONS += --artifacts-path $(BUILD_ARTIFACTS)
BUILD_OPTIONS += --no-self-contained
BUILD_OPTIONS += --nologo
BUILD_OPTIONS += /p:Version="$(VERSION)"
BUILD_OPTIONS += /p:Authors="$(AUTHORS)"
ifneq ($(strip $(PUBLIC_RELEASE)),)
BUILD_OPTIONS += /p:PublicReleaseVersion="$(PUBLIC_RELEASE)"
endif
BUILD_OPTIONS += /p:TargetOS="$(TARGET)"
PROJECT_UI ?= AGSUnpacker.UI/AGSUnpacker.UI.csproj
BUILD_PROJECTS =
BUILD_PROJECTS += AGSUnpacker.CLI
BUILD_PROJECTS += AGSUnpacker.UI
ARTIFACTS ::= $(wildcard */bin */obj)
.PHONY: all publish $(BUILD_PROJECTS) clean
all: $(BUILD_PROJECTS)
publish:
$(DOTNET) publish $(PROJECT_UI) $(BUILD_OPTIONS) -o $(BUILD_PUBLISH)
$(BUILD_PROJECTS):
$(DOTNET) build $@/$@.csproj $(BUILD_OPTIONS) -o $(BUILD_OUTPUT)
clean:
-$(RM) -r $(BUILD_DIR)
-$(RM) -r $(ARTIFACTS)