forked from ilc-opensource/smart_mug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (40 loc) · 1.04 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
ROOT=.
include common.mk
IOHUB_ROOT= $(ROOT)/lib/edison
C_FLAGS+=-I$(IOHUB_ROOT)/lib/include
LIB_PATH=$(IOHUB_ROOT)/lib/bin
BIN_PATH=bin
SRC_PATH=src
BUILD_PATH=build
TARGET=$(BIN_PATH)/libmug.a
NODE_TARGET=$(BIN_PATH)/libmug_node.a
SRCS=disp.cpp image.cpp mug.cpp motion.cpp touch.cpp adc.cpp res_manager.cpp io.cpp utf8.cpp cJSON.cpp config.cpp
OBJS=$(addprefix $(BUILD_PATH)/, $(SRCS:.cpp=.o))
NODE_OBJS= $(addprefix $(BUILD_PATH)/, $(SRCS:.cpp=_node.o))
all: init $(TARGET) $(NODE_TARGET) end
end:
@echo "done"
init:
@mkdir -p bin
@mkdir -p build
$(TARGET):$(OBJS)
cp $(LIB_PATH)/libiohub-client.a $@
$(AR) -rc $@ $^
$(BUILD_PATH)/%.o: $(SRC_PATH)/%.cpp
$(CXX) $(C_FLAGS) -c $< -o $@
$(NODE_TARGET): $(NODE_OBJS)
cp $(LIB_PATH)/libiohub-client.a $@
$(AR) -rc $@ $^
$(BUILD_PATH)/%_node.o: $(SRC_PATH)/%.cpp
$(CXX) $(NODE_C_FLAGS) -c $< -o $@
node: init $(NODE_TARGET)
native: init $(TARGET)
test:
make -C test
clean: clean_test
rm -rf build
rm -rf bin
make clean -C test
clean_test:
make clean -C test
.PHONY: clean all test