-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (75 loc) · 1.72 KB
/
Makefile
File metadata and controls
102 lines (75 loc) · 1.72 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#. ==Bam Bam==
.PHONY: default
default: all
## Sources
# NB: the wildcard function is not recursive: https://stackoverflow.com/a/2483203/112682
sources := $(shell find src -type f -iname '*.ts' | sort)
.PHONY: debug-sources
debug-sources:
$(info Sources:)
$(info - sources: $(sources))
@:
## Artifacts
objects := $(patsubst src/%.ts,dist/%.js,$(sources))
.PHONY: debug-artifacts
debug-artifacts:
$(info Artifacts:)
$(info - objects: $(objects))
@:
## Paths
.PHONY: debug-paths
debug-paths:
$(info Paths:)
$(info - node prefix: $(shell $(NPM) config get prefix))
$(info - path: $(PATH))
@:
## Programs
NODE := node
NPM := npm
.PHONY: debug-programs
debug-programs:
$(info Programs:)
$(info - NODE: $(NODE) $(shell $(NODE) --version))
$(info - NPM: $(NPM) $(shell $(NPM) --version))
@:
## Project
.PHONY: debug-project
debug-project:
$(info Project:)
@:
#. STANDARD TARGETS
.PHONY: all
all: $(objects) #> Build all artifacts
@:
.PHONY: clean
clean: #> Remove local build files
$(NPM) run clean
.PHONY: install
install: #> Add links to the current Node.js path, for each of this package's scripts
$(NPM) link
.PHONY: test
test: #> Run tests
$(NPM) run test
.PHONY: uninstall
uninstall:
@:
#. SUPPORT TARGETS
.PHONY: debug
.NOTPARALLEL: debug
debug: | debug-artifacts debug-paths debug-programs debug-project debug-sources #> Show debugging information
@:
# https://stackoverflow.com/a/47107132/112682
.PHONY: help
help: #> Show this help
@sed -n \
-e '/@sed/!s/#[.] */_margin_\n/p' \
-e '/@sed/!s/:.*#> /:/p' \
$(MAKEFILE_LIST) \
| column -ts : | sed -e 's/_margin_//'
install-assets:
@:
install-tools:
@:
#. TYPESCRIPT TARGETS
dist/%.js: src/%.ts #> Compile TypeScript to JavaScript
$(NPM) run build