-
-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathMakefile
More file actions
140 lines (114 loc) · 4.18 KB
/
Makefile
File metadata and controls
140 lines (114 loc) · 4.18 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
BUILD_DIR := build
BIN_DIR := build/bin
RM := rm
TAG := $(shell git describe --tags --abbrev=0)
APPIMAGE_BUILD_ENV_DIR := ./scripts/runners/appimage/
APPIMAGE_BUILD_ENV_IMAGE_TAG := vicinae/appimage-build-env
release:
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
.PHONY: release
host-optimized:
CXXFLAGS="${CXXFLAGS} -march=native" cmake -DLTO=ON -G Ninja -B build
cmake --build $(BUILD_DIR)
.PHONY: optimized
preview:
cmake -G Ninja -DENABLE_PREVIEW_FEATURES=ON -DCMAKE_BUILD_TYPE=Release -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
.PHONY: preview
debug:
cmake -G Ninja -DLTO=OFF -DENABLE_PREVIEW_FEATURES=ON -DENABLE_SANITIZERS=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
.PHONY: debug
debug-tidy:
# we need to run tidy with clang to avoid false positives
CC=clang CXX=clang++ cmake -G Ninja -DLTO=OFF -DENABLE_PREVIEW_FEATURES=ON -DENABLE_SANITIZERS=ON -DENABLE_CLANG_TIDY=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
.PHONY: debug-tidy
genicon:
node scripts/generate-icons.js
.PHONY: genicon
install:
cmake --install $(BUILD_DIR)
.PHONY: install
strip:
strip -s ./build/vicinae/vicinae
.PHONY: strip
test:
./$(BIN_DIR)/vicinae-emoji-tests
./$(BIN_DIR)/xdgpp-tests
./$(BIN_DIR)/scriptcommand-tests
.PHONY: test
static:
cmake -G Ninja -DPREFER_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
.PHONY: static
# optimize for portability (build problematic libs statically)
# this will increase compile time as more libraries will have to be compiled from source,
# but the resulting binary will be more portable across different distros, especially the ones
# shipping older packages.
portable:
cmake -G Ninja -DUSE_SYSTEM_PROTOBUF=OFF -DUSE_SYSTEM_ABSEIL=OFF -DUSE_SYSTEM_CMARK_GFM=OFF -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
.PHONY: portable
appimage:
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=./build/install -DVICINAE_PROVENANCE=appimage -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
cmake --install $(BUILD_DIR)
./scripts/mkappimage.sh ./build/install AppDir
.PHONY: appimage
appimage-build-env-run:
docker run -v$(PWD):/work --cap-add SYS_ADMIN --device /dev/fuse -it $(APPIMAGE_BUILD_ENV_IMAGE_TAG)
.PHONY: appimage-dev
appimage-build-env:
docker build -f $(APPIMAGE_BUILD_ENV_DIR)/AppImageBuilder.Dockerfile $(APPIMAGE_BUILD_ENV_DIR) -t $(APPIMAGE_BUILD_ENV_IMAGE_TAG)
.PHONY: appimage-build-env
appimage-build-gh-runner: appimage-build-env
docker build -f $(APPIMAGE_BUILD_ENV_DIR)/gh-runner.Dockerfile $(APPIMAGE_BUILD_ENV_DIR) -t vicinae/appimage-gh-runner
.PHONY: appimage-build-gh-runner
appimage-build-env-push:
docker push $(APPIMAGE_BUILD_ENV_IMAGE_TAG)
.PHONY: appimage-build-env-push
format:
find ./src -type f \( -name '*.cpp' -o -name '*.hpp' \) -print0 | xargs -0 -n 10 -P $(shell nproc) clang-format -i
.PHONY: format
check-format:
find ./src -type f \( -name '*.cpp' -o -name '*.hpp' \) -print0 | xargs -0 -n 10 -P $(shell nproc) clang-format --dry-run -Werror
.PHONY: check-format
bump-patch:
./scripts/bump_version.sh patch
make update-manifest
.PHONY: bump-patch
bump-minor:
./scripts/bump_version.sh minor
make update-manifest
.PHONY: bump-minor
update-manifest:
./scripts/update-manifest.sh ./manifest.yaml
.PHONY: update-manifest
# if we need to manually create a release
gh-release:
mkdir -p dist
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=dist -DCMAKE_BUILD_TYPE=Release -B $(BUILD_DIR)
cmake --build $(BUILD_DIR)
cmake --install build
tar -czvf vicinae-linux-x86_64-$(TAG).tar.gz -C dist .
.PHONY: gh-release
run-limited:
systemd-run --user --scope -p MemoryMax=1G -p MemorySwapMax=0 ./$(BIN_DIR)/vicinae-server server --frontend=qml
.PHONY: run-limited
clean:
rm -rf $(BUILD_DIR)
$(RM) -rf ./src/typescript/api/node_modules
$(RM) -rf ./src/typescript/api/dist
$(RM) -rf ./src/typescript/api/src/proto
$(RM) -rf ./src/typescript/extension-manager/dist/
$(RM) -rf ./src/typescript/extension-manager/node_modules
$(RM) -rf ./src/typescript/extension-manager/src/proto
$(RM) -rf ./scripts/.tmp
$(RM) -rf ./src/lib/*/build
.PHONY: clean
re: clean release
.PHONY: re
redev: clean dev
.PHONY: redev