-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (59 loc) · 1.86 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
60
61
62
63
64
65
66
67
68
69
70
#
# To build on RaspberryPi:
# 1. Install WiringPi: http://wiringpi.com/download-and-install/
# 2. Run:
# make target=raspberry
# sudo blynk --token=YourAuthToken
#
CC ?= gcc
CXX ?= g++
CXXFLAGS += -I ../src/ -I ./ -DLINUX
LDFLAGS += -lrt -lpthread
ifeq ($(build),debug)
CXXFLAGS += -c -g2 -O0 \
-Wall -Weffc++ \
-Wextra -Wcast-align \
-Wchar-subscripts -Wcomment -Wconversion \
-Wdisabled-optimization \
-Wfloat-equal -Wformat -Wformat=2 \
-Wformat-nonliteral -Wformat-security \
-Wformat-y2k \
-Wimplicit -Wimport -Winit-self -Winline \
-Winvalid-pch \
-Wunsafe-loop-optimizations -Wlong-long -Wmissing-braces \
-Wmissing-field-initializers -Wmissing-format-attribute \
-Wmissing-include-dirs -Wmissing-noreturn \
-Wpacked -Wparentheses -Wpointer-arith \
-Wredundant-decls -Wreturn-type \
-Wsequence-point -Wshadow -Wsign-compare -Wstack-protector \
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default \
-Wswitch-enum -Wtrigraphs -Wuninitialized \
-Wunknown-pragmas -Wunreachable-code -Wunused \
-Wunused-function -Wunused-label \
-Wunused-value -Wunused-variable \
-Wvolatile-register-var -Wwrite-strings
# Disable some warnings
CXXFLAGS += -Wno-variadic-macros -Wno-unused-parameter -Wno-vla
# Uncomment this to get pedantic warnings:
#CXXFLAGS += -pedantic -Wvariadic-macros -Wunused-parameter -Waggregate-return -Wcast-qual -Wpadded
else
CXXFLAGS += -c -O3 -w
LDFLAGS += -s
endif
ifeq ($(target),raspberry)
CXXFLAGS += -DRASPBERRY
LDFLAGS += -lwiringPi
endif
SOURCES=main.cpp \
../src/utility/BlynkDebug.cpp \
../src/utility/BlynkHandlers.cpp \
../src/utility/BlynkTimer.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=blynk
all: $(SOURCES) $(EXECUTABLE)
clean:
-rm $(OBJECTS) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CXX) $(CXXFLAGS) $< -o $@