-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
38 lines (31 loc) · 701 Bytes
/
makefile
File metadata and controls
38 lines (31 loc) · 701 Bytes
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
TTSC=node_modules/.bin/ttsc
TALIAS=node_modules/.bin/tsc-alias
TMP_INDEX=src/index.ts
DIST=dist
EGREP=egrep
ifeq ($(OS),Windows_NT)
echo 'try changing EGREP to grep'
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
EGREP=grep --extended-regexp
endif
ifeq ($(UNAME_S),Darwin)
EGREP=grep -E
endif
endif
all: build postbuild
build: index.ts
$(TTSC)
index.ts:
(cd src && find . -type f -name *.ts | sed 's/\.[^.]*$$//' | $(EGREP) -v "\./index|(spec|test|mock)s?" | awk -f ../export.awk > index.ts)
postbuild:
rm $(TMP_INDEX)
$(TALIAS) -p tsconfig.json
clean:
ifneq ("$(wildcard $(DIST))","")
rm -rd ./dist
endif
ifneq ("$(wildcard $(TMP_INDEX))","")
rm $(TMP_INDEX)
endif