-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (29 loc) · 896 Bytes
/
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
FIND := $(patsubst src/%.js,dist/%.js,$(shell find src/$(1) -iname '*.js' -and -not \( -path '*__tests__*' -or -path '*__fixtures__*' \)))
PARSER := $(call FIND,parser)
PLUGINS := $(call FIND,plugins)
TOKENIZER := $(call FIND,tokenizer)
TRAVERSER := $(call FIND,traverser)
UTIL := $(call FIND,util)
FIXTURES := parser tokenizer
FIXTURES := $(foreach fixture,$(FIXTURES),fixtures_$(fixture))
.PHONY: clean fixtures
all: parser plugins tokenizer traverser util
parser: $(PARSER)
plugins: $(PLUGINS)
tokenizer: $(TOKENIZER)
traverser: $(TRAVERSER)
util: $(UTIL)
dist/%.js: src/%.js .babelrc
@echo Compiling $<
@mkdir -p $(@D)
@babel \
--out-file $@ \
$<
fixtures: $(FIXTURES)
$(FIXTURES):
$(eval COMPONENT := $(patsubst fixtures_%,%,$@))
@echo Recreating fixtures for $(COMPONENT)
@./scripts/regenerateFixtures src/$(COMPONENT)/__fixtures__
clean:
@echo Cleaning up
@rm -rf lib/