forked from jorgecasar/flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (61 loc) · 1.8 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright (c) 2013-present, Facebook, Inc.
# All rights reserved.
.PHONY: start install serve build i18n-upload i18n-download
ifeq ($(origin DEST), undefined)
BUILD_FLAGS=
else
BUILD_FLAGS=-d $(DEST)
endif
.DEFAULT_GOAL := start
start:
@make install
@make serve
install: test-bundler test-yarn
@yarn install
@bundle install
flow_js:
(cd ..; make js)
static/master/flow.js:
mkdir -p $(dir $@)
(cd $(dir $@); ln -sf "../../../bin/flow.js" "flow.js")
static/master/flowlib:
mkdir -p $(dir $@)
(cd $(dir $@); ln -sf "../../../lib" "flowlib")
symlinks: static/master/flow.js static/master/flowlib
serve: test-jekyll symlinks
@bundle exec jekyll serve --host="::" --port=8080
build: test-jekyll symlinks
bundle exec jekyll build $(BUILD_FLAGS)
serve-production: test-jekyll flow_js symlinks
@JEKYLL_ENV=production bundle exec jekyll serve --host="::" --port=8080
build-production: test-jekyll flow_js symlinks
@JEKYLL_ENV=production bundle exec jekyll build $(BUILD_FLAGS)
# crowdin-sync: test-crowdin
# @crowdin-cli upload sources --auto-update -b master
# @crowdin-cli download -b master
###
# Misc stuff:
###
BUNDLE_EXISTS := $(shell command -v bundle 2> /dev/null)
YARN_EXISTS := $(shell command -v yarn 2> /dev/null)
JEKYLL_EXISTS := $(shell command -v jekyll 2> /dev/null)
# CROWDIN_EXISTS := $(shell command -v crowdin-cli 2> /dev/null)
test-bundler:
ifndef BUNDLE_EXISTS
$(error bundler is not installed. Run `gem install bundler`)
endif
test-yarn:
ifndef YARN_EXISTS
$(error yarn is not installed. Run `npm install yarn`)
endif
test-jekyll:
ifndef JEKYLL_EXISTS
$(error Jekyll is not installed. Run `make install`)
endif
# test-crowdin:
# ifndef CROWDIN_EXISTS
# $(error Crowdin is not installed. Run `make install`)
# endif
# ifndef CROWDIN_API_KEY
# $(error CROWDIN_API_KEY is undefined)
# endif