-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
103 lines (82 loc) · 2.93 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
101
102
103
version = 1.0
PROJECT = erocci
PROJECT_VERSION = $(shell git describe --always --tags 2> /dev/null | sed -e 's/v\(.*\)/\1/' || echo $(version))
DEV ?=
FRONTEND ?=
ROOT_DIR = $(abspath $(lastword $(MAKEFILE_LIST)))
export ROOT_DIR
DEPS = \
erocci_core \
erocci_listener_http \
erocci_backend_mnesia \
erocci_backend_dbus \
edown
ifeq ($(FRONTEND),1)
DEPS += erocci_frontend
endif
TEST_DEPS = pocci
EDOC_OPTS = {app_default, "http://www.erlang.org/doc/"} \
,{doclet, edown_doclet} \
,{top_level_readme, {"$(CURDIR)/doc/README.md", "http://github.com/erocci/erocci"}}
EDOC_SRC_DIRS = \
$(ALL_APPS_DIRS) \
$(DEPS_DIR)/occi \
$(DEPS_DIR)/erocci_core \
$(DEPS_DIR)/erocci_listener_http \
$(DEPS_DIR)/erocci_backend_mnesia \
$(DEPS_DIR)/erocci_backend_dbus
ifeq ($(DEV),1)
erocci_core_v = master
erocci_listener_http_v = master
erocci_backend_mnesia_v = master
erocci_backend_dbus_v = master
pocci_v = master
erocci_frontend_v = master
else
LOCK = deps.lock
include $(LOCK)
endif
POCCI_DATA = $(TEST_DIR)/pocci_SUITE_data/pocci.conf
dep_erocci_core = git https://github.com/erocci/erocci_core.git $(erocci_core_v)
dep_erocci_listener_http = git https://github.com/erocci/erocci_listener_http.git $(erocci_listener_http_v)
dep_erocci_backend_mnesia = git https://github.com/erocci/erocci_backend_mnesia.git $(erocci_backend_mnesia_v)
dep_erocci_backend_dbus = git https://github.com/erocci/erocci_backend_dbus.git $(erocci_backend_dbus_v)
dep_pocci = git https://github.com/jeanparpaillon/pOCCI.git $(pocci_v)
dep_erocci_frontend = git https://github.com/occiware/OCCInterface.git $(erocci_frontend_v)
include erlang.mk
# TODO: use double-quote instead of single + atom_to_list
# The problem is in correctly escaping double-quotes
define edoc.erl
SrcPaths = lists:foldl(fun (P, Acc) ->
filelib:wildcard(atom_to_list(P) ++ "/{src,c_src}") ++ Acc
end, [], [$(call comma_list,$(patsubst %,'%',$(EDOC_SRC_DIRS)))]),
DefaultOpts = [ {source_path, SrcPaths}
,{subpackages, false} ],
edoc:application($(1), ".", [$(2)] ++ DefaultOpts),
halt(0).
endef
clean:: clean-local
clean-local:
rm -f $(POCCI_DATA)
fulldoc: doc-deps
$(gen_verbose) $(call erlang,$(call edoc.erl,$(PROJECT),$(EDOC_OPTS)))
test-build:: $(POCCI_DATA)
$(POCCI_DATA):
@echo "{'POCCI', \"$(DEPS_DIR)/pocci/pOCCI/pOCCI.py\"}." > $@
lock: deps
@rm -f $(LOCK)
@for dep in occi $(DEPS) $(TEST_DEPS); do \
v=$$(cd deps/$${dep} && git describe --always); \
echo "$${dep}_v = $${v}" | tee --append $(LOCK); \
done
help:: help-local
help-local:
@echo
@echo "erocci specific targets:"
@echo " lock Update dependancies lock file"
@echo " fulldoc Build documentation for erocci and its components"
@echo ""
@echo "erocci build environment:"
@echo " DEV=1 Use 'master' version of dependancies"
@echo " FRONTEND=1 Build with JS frontend"
.PHONY: fulldoc lock clean-local help-local