-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile.pc
37 lines (27 loc) · 847 Bytes
/
makefile.pc
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
NAME = mavlink_control
# Flags
CFLAGS = -fdump-rtl-expand
# Sources
SRC = src
# Includes
INCLUDE = inc/
# MAVLink library
MAVLIB = mavlink/include/mavlink/v1.0/
# Linker
OBJS = $(NAME).o interface.o serial_port_pc.o commands.o mfunctions.o
all: $(NAME)
$(NAME): $(OBJS)
g++ $(OBJS) -o $(NAME)
$(NAME).o: $(SRC)/$(NAME).cpp
g++ $(CFLAGS) -I$(INCLUDE) -I$(MAVLIB) -c $(SRC)/$(NAME).cpp
g++ $(CFLAGS) -I$(INCLUDE) -I$(MAVLIB) -c $(SRC)/interface.cpp
g++ $(CFLAGS) -I$(INCLUDE) -I$(MAVLIB) -c $(SRC)/serial_port_pc.cpp
g++ $(CFLAGS) -I$(INCLUDE) -I$(MAVLIB) -c $(SRC)/commands.cpp
g++ $(CFLAGS) -I$(INCLUDE) -I$(MAVLIB) -c $(SRC)/mfunctions.cpp
graph: $(NAME)
mkdir Graphs
mv *.expand Graphs/
egypt Graphs/*.expand | dot -Tsvg -Grankdir=LR -o Graphs/$(NAME).svg
eog Graphs/$(NAME).svg
clean:
rm -rf *.o $(NAME) Graphs/ *.expand