-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (39 loc) · 1.61 KB
/
Makefile
File metadata and controls
54 lines (39 loc) · 1.61 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
BUILD_DIR := build
DEMO_DIR := $(BUILD_DIR)/demos
DOCS_DIR := $(BUILD_DIR)/docs
LIB_DIR := $(BUILD_DIR)/lib
DEMO_TARGETS := netsblox piano score external effects modifications analysis
TOOL_TARGETS := instrumentcreator instrumentdecompiler
.PHONY : all clean lib assets docs demos $(DEMO_TARGETS) $(TOOL_TARGETS) run
all :
$(info Make target must be one of: clean lib assets docs demos run tools)
$(LIB_DIR) :
mkdir -p "$@"
lib : $(LIB_DIR)
npm run build
assets : $(LIB_DIR)
find assets/instruments -type f | sed s,^assets/instruments/,, | tar czf $(LIB_DIR)/webAudioAPI-instruments.tgz -C assets/instruments -T -
docs :
./node_modules/.bin/jsdoc library/webaudioapi -c docs/conf.json -P package.json -R README.md -d $(DOCS_DIR)
demos : $(DEMO_TARGETS) $(TOOL_TARGETS)
demoassets :
mkdir -p "$(DEMO_DIR)"
cp -rf assets/instruments "$(DEMO_DIR)/"
cp -f demos/index.html "$(DEMO_DIR)/"
$(DEMO_TARGETS) : lib demoassets
mkdir -p "$(DEMO_DIR)/$@/js"
cp -f $(LIB_DIR)/*.js "$(DEMO_DIR)/$@/js/"
cp -f demos/$@/*.js "$(DEMO_DIR)/$@/js/"
find demos/$@/* -maxdepth 0 ! -name '*.js' -exec cp -rf "{}" "$(DEMO_DIR)/$@"/ \;
$(TOOL_TARGETS) :
mkdir -p "$(DEMO_DIR)/$@/js"
cp -f library/webaudioapi/modules/*.*js "$(DEMO_DIR)/$@/js/"
cp -f library/webaudioapi/encoders/*.*js "$(DEMO_DIR)/$@/js/"
cp -f tools/$@/*.*js "$(DEMO_DIR)/$@/js/"
find tools/$@/* -maxdepth 0 ! -name '*.*js' -exec cp -rf "{}" "$(DEMO_DIR)/$@"/ \;
run :
cd $(DEMO_DIR) && python3 -m http.server --cgi 8080
tools : $(TOOL_TARGETS)
clean :
rm -rf $(BUILD_DIR)
test : clean demos run