-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (59 loc) · 1.58 KB
/
Makefile
File metadata and controls
85 lines (59 loc) · 1.58 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
export PATH := $(PWD)/bin:$(PATH)
export INSIDE_STAGING_DIR := false
.PHONY: all build lint test format clean distclean test-unit test-integration doc FORCE
all: lint build doc test
# TypeScript targets
pre-build-ts:
rm -f .eslintcache .build-finished
build-ts: pre-build-ts $(wildcard packages/*) $(wildcard apps/*)
touch .build-finished
lint-ts:
bun prettier --check .
bun eslint --cache .
format-ts:
bun prettier --write .
test-unit:
bun test packages/
test-integration: build-anchor
bun test --timeout 30000 tests/
test-ts: test-unit test-integration
doc: FORCE
bin/generate-readme
bun prettier --write packages/*/README.md
bun typedoc
bun prettier --write docs/api/
packages/%: FORCE
cd $@ && rm -rf dist && bun run tsc && bun run tsc-esm-fix
apps/%: FORCE
cd $@ && rm -rf dist && bun run tsc && bun run tsc-esm-fix
scripts: FORCE
cd scripts && rm -rf dist && bun run tsc && bun run tsc-esm-fix
tests: FORCE
cd tests && bun run tsc
# Codama client generation
generate-client: build-anchor
bun scripts/src/generate-client.ts
# Rust/Anchor targets
build-anchor:
anchor build
lint-anchor:
cargo fmt --check
cargo clippy -- -D warnings
format-anchor:
cargo fmt
test-anchor:
anchor test
# Combined targets
build: build-ts build-anchor
lint: lint-ts lint-anchor
format: format-ts format-anchor
test: test-ts test-anchor
clean:
rm -f .eslintcache .build-finished
find . -type d -name "dist" -a ! -path '*/node_modules/*' | xargs rm -rf
anchor clean
cargo clean --manifest-path fuzz/Cargo.toml
rm -rf fuzz/artifacts
distclean: clean
rm -rf node_modules fuzz/corpus
FORCE: