2 DEPLOY_DIR=/srv/lmno.games/www
3 DO_NOT_DEPLOY=Makefile deps *.jsx .babelrc .gitignore README
4 DO_NOT_DELETE=flempires
6 REACT_DEPS=react.js react-dom.js
8 deps/react.development.js \
9 deps/react-dom.development.js \
10 deps/react.production.min.js \
11 deps/react-dom.production.min.js
13 JSX_SOURCE=$(wildcard */*.jsx)
14 JS_TARGETS=$(JSX_SOURCE:.jsx=.js)
16 all: $(JS_TARGETS) $(REACT_DEPS)
18 # Execute either of the following to build things:
20 # For a development build:
24 # For a production build:
26 # make LMNO_BUILD=production
28 # Note: To switch between these two, either issue a "make clean"
29 # or otherwise start in a clean source tree (such as a
30 # after a fresh "git clone" or use "git clean -f -x -d).
32 ifeq ($(LMNO_BUILD),production)
33 react.js: deps/react.production.min.js
36 react-dom.js: deps/react-dom.production.min.js
40 BABEL_ENV=production babeljs $^ --out-file $@
42 react.js: deps/react.development.js
45 react-dom.js: deps/react-dom.development.js
49 BABEL_ENV=development babeljs $^ --out-file $@
52 checksums: $(REACT_DOWNLOADS)
53 sha512sum --strict -c checksums.sha512
55 deps/react.development.js:
56 wget -nv -nc -P deps https://unpkg.com/react@16/umd/react.development.js
58 deps/react-dom.development.js:
59 wget -nv -nc -P deps https://unpkg.com/react-dom@16/umd/react-dom.development.js
61 deps/react.production.min.js:
62 wget -nv -nc -P deps https://unpkg.com/react@16/umd/react.production.min.js
64 deps/react-dom.production.min.js:
65 wget -nv -nc -P deps https://unpkg.com/react-dom@16/umd/react-dom.production.min.js
69 git clone . .deploy-source
70 make -C .deploy-source LMNO_BUILD=production
71 rm -rf .deploy-source/.git
72 (cd .deploy-source; rsync -avz \
73 $(DO_NOT_DEPLOY:%=--exclude=%) \
74 --exclude=$(DO_NOT_DELETE) \
77 ./ $(DEPLOY_HOST):$(DEPLOY_DIR) )
83 rm -f $(REACT_DOWNLOADS)