-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (32 loc) · 1.23 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
REBAR = ./rebar
C_SRC = apps/amber/c_src
.PHONY: all clean allclean test dialyzer deps gen drivers roboclaw_driver amber_proto
## rebar wrappers ##############################################################
fast:
$(REBAR) -j 5 skip_deps=true compile
all: deps drivers
$(REBAR) -j 5 compile
deps:
$(REBAR) -j 5 get-deps
clean:
$(REBAR) -j 5 skip_deps=true clean
allclean:
$(REBAR) -j 5 clean
gen: deps
$(REBAR) generate
test:
$(REBAR) -j 5 skip_deps=true eunit
dialyzer:
dialyzer -I apps/*/include --statistics -Wunderspecs --src apps/*/src
## drivers' compilation ########################################################
drivers: roboclaw_driver stargazer_driver ninedof_driver
roboclaw_driver: amber_proto roboclaw.proto
bash le_compiler.sh roboclaw "roboclaw_lib/*.cpp" roboclaw_lib
stargazer_driver: amber_proto stargazer.proto
bash le_compiler.sh stargazer "uart/*.cpp" uart
ninedof_driver: amber_proto ninedof.proto
bash le_compiler.sh ninedof "i2c/*.cpp" i2c
amber_proto:
protoc -I=$(C_SRC)/protobuf --cpp_out=$(C_SRC)/protobuf $(C_SRC)/protobuf/drivermsg.proto
%.proto:
protoc -I=$(C_SRC)/$(@:%.proto=%)/protobuf -I=$(C_SRC)/protobuf --cpp_out=$(C_SRC)/$(@:%.proto=%)/protobuf $(C_SRC)/$(@:%.proto=%)/protobuf/$@