-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (32 loc) · 820 Bytes
/
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
#
# Makefile to build energymonitor
#
SRCS= main.cpp \
DisplayTable.cpp \
EnergyData.cpp \
EnergyMonitorConfig.cpp \
OmnikGetStats.cpp \
P1Monitor.cpp \
PvOutput.cpp \
Tft.cpp
OBJECTS=$(subst .cpp,.o,$(SRCS))
CXX=g++
CPPFLAGS= -Wall
LDFLAGS=
LDLIBS=-lm -L/usr/lib/i386-linux-gnu -lcurl -lftdi -lcairo -lwiringPi
DEPDIR := .d
$(shell mkdir -p $(DEPDIR) >/dev/null)
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td
all: $(OBJECTS)
$(CXX) $(CPPFLAGS) -o energymonitor $(OBJECTS) $(LDFLAGS) $(LDLIBS)
clean:
rm -f *.o
rm -f energymonitor
rm -rf $(DEPDIR)
COMPILE.cpp = $(CXX) $(DEPFLAGS) $(CPPFLAGS) -c
POSTCOMPILE = mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d
%.o : %.cpp $(DEPDIR)/%.d
$(COMPILE.cpp) $(CPPFLAGS) $<
$(POSTCOMPILE)
$(DEPDIR)/%.d: ;
include $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRCS)))