-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 1.08 KB
/
Makefile
File metadata and controls
37 lines (29 loc) · 1.08 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
.PHONY: all clean check test
DEPS := $(wildcard packages/*/package.json)
PACKAGES := borsh sdk-core sdk-solana sdk-facade
ALL_TARGETS := $(foreach pkg,$(PACKAGES),packages/$(pkg)/lib)
all: $(ALL_TARGETS)
clean:
rm -rf node_modules
rm -rf $(ALL_TARGETS)
@echo Build cleaned!
node_modules/: $(DEPS)
@echo Install dependencies
npm i -ws
check:
@echo make: Entering directory "'packages/$(PKG)'"
npm run check --workspace=@race-foundation/$(PKG)
@echo make: Leaving directory "'packages/$(PKG)'"
test:
@echo make: Entering directory "'packages/$(PKG)'"
npm run test --workspace=@race-foundation/$(PKG)
@echo make: Leaving directory "'packages/$(PKG)'"
define LIB_template
packages/$(1)/lib: node_modules/ $$(wildcard packages/$(1)/src/*.ts wildcard packages/$(1)/src/**/*.ts packages/$(1)/*.js packages/$(1)/*.json)
@echo make: Entering directory "'packages/$(1)'"
npm run check --workspace=@race-foundation/$(1)
npm run build --workspace=@race-foundation/$(1)
touch $$@
@echo make: Leaving directory "'packages/$(1)'"
endef
$(foreach pkg,$(PACKAGES),$(eval $(call LIB_template,$(pkg))))