forked from Thunderbird301/react-addon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·33 lines (25 loc) · 692 Bytes
/
Copy pathmakefile
File metadata and controls
executable file
·33 lines (25 loc) · 692 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
NAME:=react-test
NAME_XPI:=$(NAME).xpi
XPI_SRC:=$(shell find content -type f) $(shell find modules -type f) $(shell find defaults -type f)
SRC = $(wildcard react/*.jsx)
LIB = $(SRC:react/%.jsx=modules/react/%.js)
all: react xpi
modules/react:
mkdir -p $(@D)
modules/react/%.js: react/%.jsx
ifeq (, $(shell which node ))
nodejs node_modules/.bin/babel $< -o $@ --presets react
else
node node_modules/.bin/babel $< -o $@ --presets react
endif
react: npm modules/react $(LIB)
xpi: $(NAME_XPI)
$(NAME_XPI): $(XPI_SRC) $(LIB) chrome.manifest install.rdf
zip -r $@ $^
npm: node_modules
node_modules: package.json
npm install
clean:
rm -f $(LIB)
rm -f $(NAME_XPI)
rebuild: clean all