blob: 9ce7c8f3c8f99ed88007c2ae6c7f5b8e1ffa65b0 [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 \
7
8LIB_APP = libapphandler.so
vishwabmcba0bd5f2015-09-30 16:50:23 +05309
Chris Austen0ba649e2015-10-13 12:28:13 -050010INC_FLAG += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 --std=gnu++11
11LIB_FLAG += $(shell pkg-config --libs libsystemd) -rdynamic
vishwabmcba0bd5f2015-09-30 16:50:23 +053012IPMID_PATH ?= -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\"
13
Chris Austenac4604a2015-10-13 12:43:27 -050014all: $(DAEMON) $(LIB_APP)
vishwabmcba0bd5f2015-09-30 16:50:23 +053015
16%.o: %.C
17 $(CXX) -fpic -c $< $(CXXFLAGS) $(INC_FLAG) $(IPMID_PATH) -o $@
18
Chris Austenac4604a2015-10-13 12:43:27 -050019$(LIB_APP): $(LIB_APP_OBJ)
vishwabmcba0bd5f2015-09-30 16:50:23 +053020 $(CXX) $^ -shared $(LDFLAGS) $(LIB_FLAG) -o $@
21
22$(DAEMON): $(DAEMON_OBJ)
23 $(CXX) $^ $(LDFLAGS) $(LIB_FLAG) -o $@ -ldl
24
25clean:
26 rm -f $(DAEMON) *.o *.so