-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
60 lines (39 loc) · 1.12 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
MBC_CONFIG="${PWD}/common/config"
NODE_CONFIG_DIR=${MBC_CONFIG}
MAKEFLAGS += -j 4
SERVERS = caspa mosto
COMPONENTS= ${SERVERS} common
MBC_VARS = \
NODE_CONFIG_DIR=${NODE_CONFIG_DIR} \
MBC_SCRAPE=${MBC_SCRAPE} \
${NULL}
MBC_DEFAULT_BRANCH = origin/master
.PHONY: common caspa mosto update serve links
all: update serve
update: submodules links
%-update:
cd $* ; git fetch --prune ; git checkout ${MBC_DEFAULT_BRANCH}
submodules: common caspa mosto
common: common-update common/package.json common/node_modules
%/node_modules:
cd $*; npm install;
caspa: caspa-update caspa/package.json
mosto: mosto-update mosto/package.json
%/package.json:
git submodule update --recursive --init $@
cd $@; npm install;
node_modules:
mkdir -p $@
npm:
npm install
links: mosto-common caspa-common
mosto-common: common mosto/node_modules/mbc-common
caspa-common: common caspa/node_modules/mbc-common
%/node_modules/mbc-common: %/node_modules
ln -sf ${PWD}/common ${PWD}/$*/node_modules/mbc-common
cd $*; npm install;
%-serve:
@cd $*; make ${MBC_VARS} serve
serve: mosto-serve caspa-serve
node server.js
.PHONY: npm submodules serve