-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 719 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 719 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
SRC = JSON-Schema-Test-Suite/tests/draft4
DST = test/suite
DSTNODE = test/suite.node
SRCFILES = $(wildcard $(SRC)/*.json)
JSON = $(notdir $(SRCFILES))
JS = $(addsuffix .js, $(basename $(JSON)))
DSTFILES = $(JS:%.js=$(DST)/%.js)
DSTNODEFILES = $(JSON:%.json=$(DSTNODE)/%.json)
build: components index.js $(DSTFILES)
@component build --dev
components: component.json
@component install --dev
$(DST)/%.js: $(SRC)/%.json
@mkdir -p $(DST)
@echo "window['json-schema-test-suite']['$(basename $(notdir $@))'] = " > $@
@cat "$<" >> $@
@echo ";" >> $@
node: $(DSTNODEFILES)
$(DSTNODE)/%.json: $(SRC)/%.json
@mkdir -p $(DSTNODE)
@cat "$<" >> $@
clean:
rm -fr build components $(DST) $(DSTNODE)
.PHONY: clean