-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
142 lines (116 loc) · 4.64 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
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
141
142
FLATPAK := $(shell which flatpak)
FLATPAK_BUILDER := $(shell which flatpak-builder)
PYTHON := $(shell which python3)
FLATPAK_NODE_GENERATOR := $(shell which flatpak-node-generator)
FLATPAK_MANIFEST=org.nanuc.Axolotl.yml
FLATPAK_APPID=org.nanuc.Axolotl
FLATPAK_BUILD_FLAGS := --verbose --force-clean --install-deps-from=flathub --ccache
FLATPAK_INSTALL_FLAGS := --verbose --force-clean --ccache --user --install
FLATPAK_DEBUG_FLAGS := --verbose --run
all: build
.PHONY: build-dependencies
build-dependencies:
$(FLATPAK) install org.freedesktop.Sdk.Extension.golang//21.08
$(FLATPAK) install org.freedesktop.Sdk.Extension.node16//21.08
$(FLATPAK) install org.freedesktop.Sdk.Extension.rust-stable//21.08
$(FLATPAK) install org.freedesktop.Platform//21.08
$(FLATPAK) install org.freedesktop.Sdk//21.08
$(FLATPAK) install org.electronjs.Electron2.BaseApp//21.08
.PHONY: build
build:
@echo "Building flatpak..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) $(FLATPAK_MANIFEST)
.PHONY: build-crayfish
build-crayfish:
@echo "Building crayfish..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) --stop-at=zkgroup $(FLATPAK_MANIFEST)
.PHONY: build-zkgroup
build-zkgroup:
@echo "Building zkgroup..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) --stop-at=astilectron-bundler $(FLATPAK_MANIFEST)
.PHONY: build-astilectron-bundler
build-astilectron-bundler:
@echo "Building astilectron-bundler..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) --stop-at=axolotl-electron-bundle $(FLATPAK_MANIFEST)
.PHONY: build-astilectron-bundler-resources
build-astilectron-bundler-resources:
@echo "Building astilectron-bundler-resources..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) --stop-at=axolotl-electron-bundle $(FLATPAK_MANIFEST)
.PHONY: build-electron-bundle
build-electron-bundle:
@echo "Building electron-bundle..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) --stop-at=metadata $(FLATPAK_MANIFEST)
.PHONY: build-metadata
build-metadata:
@echo "Building metadata..."
$(FLATPAK_BUILDER) build $(FLATPAK_BUILD_FLAGS) --stop-at=run $(FLATPAK_MANIFEST)
.PHONY: debug
debug:
$(FLATPAK_BUILDER) $(FLATPAK_DEBUG_FLAGS) build $(FLATPAK_MANIFEST) sh
.PHONY: debug-crayfish
debug-crayfish:
$(FLATPAK_BUILDER) build $(FLATPAK_MANIFEST) --build-shell=crayfish
.PHONY: debug-zkgroup
debug-zkgroup:
$(FLATPAK_BUILDER) build $(FLATPAK_MANIFEST) --build-shell=zkgroup
.PHONY: debug-electron-bundle
debug-electron-bundle:
$(FLATPAK_BUILDER) build $(FLATPAK_MANIFEST) --build-shell=axolotl-electron-bundle
.PHONY: debug-installed
debug-installed:
$(FLATPAK) run --command=sh --devel $(FLATPAK_APPID)
.PHONY: install
install:
@echo "Installing flatpak..."
$(FLATPAK_BUILDER) build $(FLATPAK_INSTALL_FLAGS) $(FLATPAK_MANIFEST)
.PHONY: uninstall
uninstall:
$(FLATPAK) uninstall --delete-data --assumeyes $(FLATPAK_APPID)
.PHONY: run
run:
$(FLATPAK) run $(FLATPAK_APPID)
.PHONY: update-submodules
update-submodules:
git submodule foreach git pull
.PHONY: install-flatpak-node-generator
install-flatpak-node-generator:
pipx install --force ./flatpak-builder-tools/node
.PHONY: generate-astilectron-bundler-sources
generate-astilectron-bundler-sources:
@echo "Generating astilectron-bundler sources..."
$(FLATPAK_BUILDER) build astilectron-bundler-download-manifest.yml \
--verbose \
--keep-build-dirs \
--force-clean \
--disable-cache
$(PYTHON) flatpak-builder-tools/go-get/flatpak-go-get-generator.py .flatpak-builder/build/astilectron-bundler
mv astilectron-bundler-sources.json generated-astilectron-bundler-sources.json
.PHONY: generate-axolotl-sources
generate-axolotl-sources:
@echo "Generating axolotl sources..."
$(FLATPAK_BUILDER) build axolotl-download-manifest.yml \
--verbose \
--keep-build-dirs \
--force-clean \
--disable-cache
$(PYTHON) flatpak-builder-tools/go-get/flatpak-go-get-generator.py .flatpak-builder/build/axolotl
mv axolotl-sources.json generated-axolotl-sources.json
.PHONY: generate-axolotl-web-sources
generate-axolotl-web-sources:
@echo "Generating axolotl-web sources..."
$(FLATPAK_NODE_GENERATOR) npm ../axolotl/axolotl-web/package-lock.json \
--recursive \
--split \
--output generated-axolotl-web-sources.json
.PHONY: generate-zkgroup-sources
generate-zkgroup-sources:
@echo "Generating zkgroup sources..."
$(PYTHON) flatpak-builder-tools/cargo/flatpak-cargo-generator.py \
../zkgroup/lib/zkgroup/Cargo.lock \
--output generated-zkgroup-sources.json
.PHONY: generate-crayfish-sources
generate-crayfish-sources:
@echo "Generating crayfish sources..."
$(PYTHON) flatpak-builder-tools/cargo/flatpak-cargo-generator.py \
../axolotl/crayfish/Cargo.lock \
--output generated-crayfish-sources.json