blob: 93d3256d6708f8b9de61547c138ceba19d18a389 [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 Austenac4604a2015-10-13 12:43:27 -05008
9LIB_APP = libapphandler.so
vishwabmcba0bd5f2015-09-30 16:50:23 +053010
Chris Austen0ba649e2015-10-13 12:28:13 -050011INC_FLAG += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 --std=gnu++11
12LIB_FLAG += $(shell pkg-config --libs libsystemd) -rdynamic
vishwabmcba0bd5f2015-09-30 16:50:23 +053013IPMID_PATH ?= -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\"
14
Chris Austenac4604a2015-10-13 12:43:27 -050015all: $(DAEMON) $(LIB_APP)
vishwabmcba0bd5f2015-09-30 16:50:23 +053016
17%.o: %.C
18 $(CXX) -fpic -c $< $(CXXFLAGS) $(INC_FLAG) $(IPMID_PATH) -o $@
19
Chris Austenac4604a2015-10-13 12:43:27 -050020$(LIB_APP): $(LIB_APP_OBJ)
vishwabmcba0bd5f2015-09-30 16:50:23 +053021 $(CXX) $^ -shared $(LDFLAGS) $(LIB_FLAG) -o $@
22
23$(DAEMON): $(DAEMON_OBJ)
24 $(CXX) $^ $(LDFLAGS) $(LIB_FLAG) -o $@ -ldl
25
26clean:
27 rm -f $(DAEMON) *.o *.so