summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/common.mk')
-rw-r--r--daemon/common.mk16
1 files changed, 9 insertions, 7 deletions
diff --git a/daemon/common.mk b/daemon/common.mk
index d9dc146..769a92e 100644
--- a/daemon/common.mk
+++ b/daemon/common.mk
@@ -5,16 +5,17 @@
5# -Werror treats warnings as errors 5# -Werror treats warnings as errors
6# -std=c++0x is the planned new c++ standard 6# -std=c++0x is the planned new c++ standard
7# -std=c++98 is the 1998 c++ standard 7# -std=c++98 is the 1998 c++ standard
8CFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors 8CPPFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors
9CXXFLAGS += -fno-rtti -Wextra # -Weffc++ 9CXXFLAGS += -fno-rtti -Wextra # -Weffc++
10ifeq ($(WERROR),1) 10ifeq ($(WERROR),1)
11 CFLAGS += -Werror 11 CPPFLAGS += -Werror
12endif 12endif
13# -s strips the binary of debug info 13# -s strips the binary of debug info
14LDFLAGS += -s 14LDFLAGS += -s
15LDLIBS += -lrt -lm -pthread
15TARGET = gatord 16TARGET = gatord
16C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c) 17C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c)
17CPP_SRC = $(wildcard *.cpp) 18CXX_SRC = $(wildcard *.cpp)
18 19
19all: $(TARGET) 20all: $(TARGET)
20 21
@@ -35,14 +36,15 @@ libsensors/conf-parse.c: ;
35 ./escape $< > $@ 36 ./escape $< > $@
36 37
37%.o: %.c 38%.o: %.c
38 $(GCC) -c $(CFLAGS) -o $@ $< 39 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
39 40
40%.o: %.cpp 41%.o: %.cpp
41 $(CPP) -c $(CFLAGS) $(CXXFLAGS) -o $@ $< 42 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
42 43
43$(TARGET): $(CPP_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o) 44$(TARGET): $(CXX_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o)
44 $(CPP) $(LDFLAGS) -o $@ $^ -lrt -pthread 45 $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
45 46
47# Intentionally ignore CC as a native binary is required
46escape: escape.c 48escape: escape.c
47 gcc $^ -o $@ 49 gcc $^ -o $@
48 50