-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.variable
82 lines (63 loc) · 2 KB
/
Makefile.variable
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
##### For sub projects
PROJECT_NAME=
VERSION=
DOTNET=dotnet
DOTNET_VERSION=net6.0
DIST_DIR=bin
DEBUG_DIR=$(DIST_DIR)/Debug/$(DOTNET_VERSION)
RELEASE_DIR=$(DIST_DIR)/Release/$(DOTNET_VERSION)
FOLDER_DIST_DIR=$(DIST_DIR)/$(PROJECT_NAME)
TRANSLATION_DIR=data/i18n
DOCS_COMPILE=cd docs && pandoc -t gfm --fail-if-warnings
UPDATE_VERSIONS=$(shell ../scripts/update_versions.sh $(VERSION))
all: translation
dotnet tool restore
$(UPDATE_VERSIONS)
$(DOTNET) build
update_versions:
$(UPDATE_VERSIONS)
translation:
mkdir -p $(RELEASE_DIR)
mkdir -p $(DEBUG_DIR)
mkdir -p $(TRANSLATION_DIR)
cp -r $(TRANSLATION_DIR) $(RELEASE_DIR)
cp -r $(TRANSLATION_DIR) $(DEBUG_DIR)
# quick
q: translation
$(DOTNET) build --no-restore
documentation: update_versions
$(DOCS_COMPILE) README.tex -o ../README.md
$(DOCS_COMPILE) CHANGELOG.tex -o ../CHANGELOG.md
documentation_plain:
cd docs && pandoc -t plain README.tex -o ../README.txt
cd docs && pandoc -t plain CHANGELOG.tex -o ../CHANGELOG.txt
documentation_bbcode:
cd docs && pandoc -t ../../docs/bbcode_nexusmods.lua README.tex -o ../README.bbcode
cd docs && pandoc -t ../../docs/bbcode_nexusmods.lua CHANGELOG.tex -o ../CHANGELOG.bbcode
release:
rm -rf bin/ obj/
$(DOTNET) clean
$(UPDATE_VERSIONS)
$(DOTNET) build --configuration Release
cp -r ./manifest.json $(RELEASE_DIR)
-cp -r ./sublicenses/ $(RELEASE_DIR)
mkdir -p $(FOLDER_DIST_DIR)/
mkdir -p $(RELEASE_DIR)
mkdir -p $(DEBUG_DIR)
cp -r $(TRANSLATION_DIR) $(RELEASE_DIR)
cp -r $(TRANSLATION_DIR) $(DEBUG_DIR)
$(DOCS_COMPILE) README.tex -o ../README.md
$(DOCS_COMPILE) CHANGELOG.tex -o ../CHANGELOG.md
cp -f README.md $(RELEASE_DIR)
cp -f CHANGELOG.md $(RELEASE_DIR)
cp -f README.md $(DEBUG_DIR)
cp -f CHANGELOG.md $(DEBUG_DIR)
cp -f ../LICENSE $(RELEASE_DIR)
cp -f ../LICENSE $(DEBUG_DIR)
rm -f $(RELEASE_DIR)/$(PROJECT_NAME).deps.json
cp -r $(RELEASE_DIR)/* $(FOLDER_DIST_DIR)/
cd $(DIST_DIR) && zip -9 -r $(PROJECT_NAME).zip $(PROJECT_NAME)
clean:
rm -rf bin/ obj/
$(DOTNET) clean
##### For sub projects