aboutsummaryrefslogtreecommitdiff
path: root/daemon/common.mk
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2014-07-16 12:00:00 -0700
committerDrew Richardson <drew.richardson@arm.com>2014-12-19 15:54:51 -0800
commit8b39b6c50a01bcfa280151b43079dab428cbab45 (patch)
tree66294093e2cd51c0df7afa6d119ec78f65274515 /daemon/common.mk
parent020278c1a682ea75ddb63fe4e0d373116935199f (diff)
downloadgator-5.19.tar.gz
gator: Version 5.195.19
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
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 @@
# -Werror treats warnings as errors
# -std=c++0x is the planned new c++ standard
# -std=c++98 is the 1998 c++ standard
-CFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors
+CPPFLAGS += -O3 -Wall -fno-exceptions -pthread -MMD -DETCDIR=\"/etc\" -Ilibsensors
CXXFLAGS += -fno-rtti -Wextra # -Weffc++
ifeq ($(WERROR),1)
- CFLAGS += -Werror
+ CPPFLAGS += -Werror
endif
# -s strips the binary of debug info
LDFLAGS += -s
+LDLIBS += -lrt -lm -pthread
TARGET = gatord
C_SRC = $(wildcard mxml/*.c) $(wildcard libsensors/*.c)
-CPP_SRC = $(wildcard *.cpp)
+CXX_SRC = $(wildcard *.cpp)
all: $(TARGET)
@@ -35,14 +36,15 @@ libsensors/conf-parse.c: ;
./escape $< > $@
%.o: %.c
- $(GCC) -c $(CFLAGS) -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
%.o: %.cpp
- $(CPP) -c $(CFLAGS) $(CXXFLAGS) -o $@ $<
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
-$(TARGET): $(CPP_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o)
- $(CPP) $(LDFLAGS) -o $@ $^ -lrt -pthread
+$(TARGET): $(CXX_SRC:%.cpp=%.o) $(C_SRC:%.c=%.o)
+ $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
+# Intentionally ignore CC as a native binary is required
escape: escape.c
gcc $^ -o $@