-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathMakefile
70 lines (52 loc) · 1.98 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
.PHONY: build-image std-install dep all install test api-reference FORCE
all: jk
VERSION := $(shell git describe --tags)
jk: pkg/__std/lib/assets_vfsdata.go FORCE
ifeq ($(STATIC),yes)
GO111MODULE=on go build -mod=readonly -a -tags netgo -o $@ -ldflags '-X main.Version=$(VERSION) -s -w -extldflags "-static"'
else
GO111MODULE=on go build -mod=readonly -o $@ -ldflags "-X main.Version=$(VERSION) -s -w"
endif
pkg/__std/lib/assets_vfsdata.go: std/internal/__std_generated.ts std/dist/index.js
GO111MODULE=on go generate -mod=readonly ./pkg/__std/lib
std/internal/__std_generated.ts: std/internal/*.fbs std/package.json std/generate.sh
std/generate.sh
std_sources = std/*.js std/*.ts std/internal/*.ts std/internal/*.js std/cmd/*.ts std/cmd/*.js
std/dist/index.js: $(std_sources)
rm -rf ./std/dist
mkdir -p std/dist
cd std && npm run build
module = @jkcfg/std
module: $(module)/package.json
$(module)/package.json: $(std_sources) std/internal/__std_generated.ts std/package.json
cd std && npx tsc --outDir ../$(module)
cd std && npx tsc --declaration --emitDeclarationOnly --allowJs false --outdir ../$(module) || true
cp README.md LICENSE std/package.json std/internal/flatbuffers.d.ts $(module)
D := $(shell go env GOPATH)/bin
install: jk
mkdir -p $(D)
cp jk $(D)
build-image:
docker build -t jkcfg/build -f build/Dockerfile build/
# Pulls the std/node_modules directory
std-install:
cd std && npm ci
# Clone the theme directory
typedoc-theme-install:
rm -rf std/typedoc-theme && git clone https://github.com/jkcfg/typedoc-theme.git std/typedoc-theme
# This target installs build dependencies
dep: std-install typedoc-theme-install
test: module
./run-tests.sh
api-reference: $(std_sources)
cd std && npm run doc
clean-tests:
@rm -rf tests/*.got
clean: clean-tests
@rm -f jk
@rm -rf .bash_history .cache/ .config/ .npm
@rm -rf std/dist std/internal/__std_generated.js std/internal/__std_generated.ts
@rm -rf @jkcfg
dep-clean: clean
@rm -rf std/node_modules
@rm -rf std/typedoc-theme