-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (58 loc) · 2.41 KB
/
Copy pathMakefile
File metadata and controls
68 lines (58 loc) · 2.41 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
.PHONY: clean deps build extract deploy generate mulauth whoami all
# Clean and start dfx in background
clean:
@echo "🧹 Cleaning and restarting dfx..."
dfx stop
dfx killall
dfx start --background --clean
@echo "✅ Dfx cleaned and restarted!"
# Pull dependencies, init and deploy
deps:
@echo "📦 Pulling and deploying dependencies..."
dfx deps pull
dfx deps init
dfx deps deploy
@echo "✅ Dependencies deployed!"
# Build both canisters
build:
@echo "🔨 Building both canisters..."
cargo build --release --target wasm32-unknown-unknown --package mulauth
cargo build --release --target wasm32-unknown-unknown --package whoami
@echo "✅ Build complete!"
# Extract candid
extract:
@echo "📄 Extracting candid files..."
candid-extractor target/wasm32-unknown-unknown/release/mulauth.wasm > backend/mulauth/mulauth.did
candid-extractor target/wasm32-unknown-unknown/release/whoami.wasm > backend/whoami/whoami.did
@echo "✅ Candid files extracted!"
# Deploy with specific IDs
deploy:
@echo "🚀 Deploying both canisters..."
dfx deploy mulauth --mode=reinstall --yes --specified-id 4n3qe-piaaa-aaaab-qac7a-cai
dfx deploy whoami --mode=reinstall --yes --specified-id 4k2wq-cqaaa-aaaab-qac7q-cai
@echo "✅ Both canisters deployed!"
# Generate declarations
generate:
@echo "📝 Generating declarations..."
dfx generate mulauth
dfx generate whoami
@echo "✅ Declarations generated!"
# Build, extract, deploy and generate for mulauth canister only
mulauth:
@echo "🚀 Starting mulauth canister build and deployment..."
cargo build --release --target wasm32-unknown-unknown --package mulauth
candid-extractor target/wasm32-unknown-unknown/release/mulauth.wasm > backend/mulauth/mulauth.did
dfx deploy mulauth --mode=reinstall --yes --specified-id 4n3qe-piaaa-aaaab-qac7a-cai
dfx generate mulauth
@echo "✅ Mulauth canister deployment complete!"
# Build, extract, deploy and generate for whoami canister only
whoami:
@echo "🚀 Starting whoami canister build and deployment..."
cargo build --release --target wasm32-unknown-unknown --package whoami
candid-extractor target/wasm32-unknown-unknown/release/whoami.wasm > backend/whoami/whoami.did
dfx deploy whoami --mode=reinstall --yes --specified-id 4k2wq-cqaaa-aaaab-qac7q-cai
dfx generate whoami
@echo "✅ Whoami canister deployment complete!"
# Full development cycle
all: clean deps build extract deploy generate
@echo "🎉 Full development setup complete!"