-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
100 lines (72 loc) · 2.86 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
VERSION=$(shell echo `git describe --tags`)
#PREFIX=/opt/imgflo
PREFIX=$(shell echo `pwd`/install)
#TESTS=
PROJECTDIR=$(shell echo `pwd`)
ifdef TESTS
TEST_ARGUMENTS=--grep "$(TESTS)"
endif
DEPS_VERSION=112
TRAVIS_DEPENDENCIES="https://github.com/imgflo/imgflo-dependencies/releases/download/${DEPS_VERSION}/imgflo-dependencies-travis-${TRAVIS_OS_NAME}.tgz"
FBP_GRAPHS = $(wildcard ./graphs/*.fbp)
JSON_GRAPHS = $(wildcard ./graphs/*.json)
GRAPHS=$(FBP_GRAPHS:%.fbp=%.json.info)
GRAPHS+=$(JSON_GRAPHS:%.json=%.json.info)
INTERNAL_GRAPHS=./graphs/imgflo-server.json.info ./graphs/performance.json.info
PROCESSING_GRAPHS:=$(filter-out $(INTERNAL_GRAPHS),$(GRAPHS))
all: install
run: install
npm start
run-runtime: runtime
cd runtime && make PREFIX=$(PREFIX) run
runtime:
cd runtime && npm install && make PREFIX=$(PREFIX) install
version:
echo 'No version info installed'
install: env version procfile runtime components graphs webpack
env:
mkdir -p $(PREFIX) || true
sed -e 's|@PREFIX@|$(PREFIX)|' runtime/env.sh.in > $(PREFIX)/env.sh
chmod +x $(PREFIX)/env.sh
travis-deps:
wget -O imgflo-dependencies.tgz $(TRAVIS_DEPENDENCIES)
tar -xf imgflo-dependencies.tgz
components: env
cd runtime && make components PREFIX=$(PREFIX) COMPONENTDIR=$(PROJECTDIR)/components/extra
component: env
cd runtime && make component PREFIX=$(PREFIX) \
COMPONENT=$(COMPONENT) \
COMPONENTINSTALLDIR=$(COMPONENTINSTALLDIR) \
COMPONENTDIR=$(COMPONENTDIR) \
COMPONENT_NAME_PREFIX=$(COMPONENT_NAME_PREFIX) \
COMPONENT_NAME_SUFFIX=$(COMPONENT_NAME_SUFFIX)
%.json: %.fbp
./node_modules/.bin/fbp $< > $@
%.json.info: %.json
$(PREFIX)/env.sh imgflo-graphinfo --graph $< > $@
graphs: $(PROCESSING_GRAPHS)
procfile:
./node_modules/.bin/msgflo-procfile --ignore imgflo_api --ignore pubsub --ignore pubsub_noflo --ignore pubsub_video --include 'web: node index.js' ./graphs/imgflo-server.fbp > Procfile
webpack:
./node_modules/.bin/webpack
dependencies:
cd runtime/dependencies && make PREFIX=$(PREFIX) dependencies
gegl:
cd runtime/dependencies && make PREFIX=$(PREFIX) gegl
babl:
cd runtime/dependencies && make PREFIX=$(PREFIX) babl
glib:
cd runtime/dependencies && make PREFIX=$(PREFIX) glib
libsoup:
cd runtime/dependencies && make PREFIX=$(PREFIX) libsoup
check: install runtime-check server-check
server-check:
echo "WARNING: You need to setup RabbitMQ to run tests, due to https://github.com/msgflo/msgflo-nodejs/issues/1"
IMGFLO_BROKER_URL=amqp://localhost ./node_modules/.bin/mocha --reporter spec --compilers .coffee:coffee-script/register ./spec/*.coffee $(TEST_ARGUMENTS)
runtime-check:
./node_modules/.bin/mocha --reporter spec --compilers .coffee:coffee-script/register ./runtime/spec/*.coffee $(TEST_ARGUMENTS)
clean:
git clean -dfx --exclude node_modules --exclude install
release: check
cd $(PREFIX) && tar -caf ../imgflo-$(VERSION).tgz ./
.PHONY:all run dependencies runtime graphs