-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 830 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 830 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
CC = cc
CXX = c++
CFLAGS = -g -O3 -Wall -std=c++0x -MMD -MD -pthread
LIBS = -lm -lpthread -lmosquitto
LDFLAGS = -g
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
DEPS = $(SRCS:.cpp=.d)
all: DAPNETGateway
DAPNETGateway: GitVersion.h $(OBJS)
$(CXX) $(OBJS) $(CFLAGS) $(LIBS) -o DAPNETGateway
%.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $<
-include $(DEPS)
DAPNETGateway.o: GitVersion.h FORCE
.PHONY: GitVersion.h
FORCE:
install:
install -m 755 DAPNETGateway /usr/local/bin/
clean:
$(RM) DAPNETGateway *.o *.d *.bak *~
# Export the current git version if the index file exists, else 000...
GitVersion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif