-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (25 loc) · 785 Bytes
/
Makefile
File metadata and controls
36 lines (25 loc) · 785 Bytes
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
#
# Robot Control Module Makefile
#
CROSSTOOL_PATH=${HOME}/robot/crosstool-ng/x-tools7h/arm-unknown-linux-gnueabihf/bin
NAME=control_module.out
CPP=$(CROSSTOOL_PATH)/arm-unknown-linux-gnueabihf-g++
CPPFLAGS=-g -O2 -MMD -std=c++0x -fno-exceptions -fno-rtti -pthread
LDFLAGS=-lrt -pthread -static
MODULES := utils sensors protocol
SOURCES := $(wildcard *.cpp)
-include $(patsubst %, %/module.mk, $(MODULES))
OBJECTS := $(patsubst %.cpp, %.o, $(filter %.cpp,$(SOURCES)))
.PHONY: all
all : compile_all
%.o : %.cpp
$(CPP) $(CPPFLAGS) $(INCLUDES) -c -o $@ $<
$(NAME) : $(OBJECTS)
$(CPP) -o $@ $^ $(LDFLAGS)
.PHONY: compile_all
compile_all: $(NAME)
.PHONY: clean
clean :
@rm -f $(OBJECTS) $(NAME)
@rm -f $(patsubst %.o, %.d, $(filter %.o,$(OBJECTS)))
-include $(OBJECTS:.o=.d)