blob: 2177c9db0cc3bf3bd9caa36a577cda6028d794e0 [file] [log] [blame]
vishwabmcba0bd5f2015-09-30 16:50:23 +05301CXX ?= $(CROSS_COMPILE)g++
2
3DAEMON = ipmid
Chris Austenac4604a2015-10-13 12:43:27 -05004DAEMON_OBJ = $(DAEMON).o
5LIB_APP_OBJ = apphandler.o \
6 sensorhandler.o \
Chris Austenb4f5b922015-10-13 12:44:43 -05007 storagehandler.o \
Chris Austen1810bec2015-10-13 12:12:39 -05008 dcmihandler.o
Chris Austenac4604a2015-10-13 12:43:27 -05009
10LIB_APP = libapphandler.so
vishwabmcba0bd5f2015-09-30 16:50:23 +053011
Chris Austen0ba649e2015-10-13 12:28:13 -050012INC_FLAG += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 --std=gnu++11
13LIB_FLAG += $(shell pkg-config --libs libsystemd) -rdynamic
vishwabmcba0bd5f2015-09-30 16:50:23 +053014IPMID_PATH ?= -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\"
15
Chris Austenac4604a2015-10-13 12:43:27 -050016all: $(DAEMON) $(LIB_APP)
vishwabmcba0bd5f2015-09-30 16:50:23 +053017
18%.o: %.C
19 $(CXX) -fpic -c $< $(CXXFLAGS) $(INC_FLAG) $(IPMID_PATH) -o $@
20
Chris Austenac4604a2015-10-13 12:43:27 -050021$(LIB_APP): $(LIB_APP_OBJ)
vishwabmcba0bd5f2015-09-30 16:50:23 +053022 $(CXX) $^ -shared $(LDFLAGS) $(LIB_FLAG) -o $@
23
24$(DAEMON): $(DAEMON_OBJ)
25 $(CXX) $^ $(LDFLAGS) $(LIB_FLAG) -o $@ -ldl
26
27clean:
28 rm -f $(DAEMON) *.o *.so