-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 666 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 666 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
CXX=g++
CXXFLAGS = -g -O2 -Wall -MMD -MP -std=gnu++11 -fstack-protector-all -Wextra -I.
LIBS = -lpthread -fstack-protector -s
ifeq ($(OS),Windows_NT)
CXXFLAGS += -DWIN32
LIBS += -lwsock32 -static
else
ifeq ($(shell test -e /etc/os-release && echo -n yes),yes)
ifeq ($(shell if [ `grep -c raspbian /etc/os-release` -gt 0 ]; then echo true ; else echo false ; fi), true)
CXXFLAGS += -DRASPBIAN
endif
endif
endif
srcs = $(wildcard *.cpp)
objs = $(srcs:.cpp=.o)
deps = $(srcs:.cpp=.d)
vbit2: $(objs)
$(CXX) -o $@ $^ $(LIBS)
%.o: %.c $(deps)
$(CXX) -c $< -o $@
#Cleanup
.PHONY: clean
clean:
rm -f $(objs) $(deps) vbit2
-include $(deps)
all: vbit2