-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (35 loc) · 860 Bytes
/
Makefile
File metadata and controls
51 lines (35 loc) · 860 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Target name
TARGET = smart_node
# Compiler
CXX = g++
# Linker flags
LDFLAGS = -lgpiod -lpaho-mqttpp3 -lpaho-mqtt3as
# List of source file
SRCS = main.cpp hal/led_controller.cpp hal/bh1750.cpp hal/ili9341.cpp hal/gpio.cpp hal/font.cpp hal/dht11.cpp utility.cpp mqtt/mqtt_client.cpp
# List of object file
OBJS = $(SRCS:.cpp=.o)
# Rule compile
all: $(TARGET)
# Link object files to target file
$(TARGET): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
# Compile object files
%.o: %.cpp
$(CXX) -c $< -o $@
clean:
rm -f $(TARGET) *.o
.PHONY: all clean
# # Makefile for only one main.cpp
# # Target name
# TARGET = smart_node
# # Compiler
# CXX = g++
# # List of source code
# SRCS = main.cpp
# # Rule compile code: g+ main.cpp -o smart_node
# all: $(TARGET)
# $(TARGET):$(SRCS)
# $(CXX) $(SRCS) -o $@
# clean:
# rm -f $(TARGET)
# .PHONY: all clean