blob: be3aeddda0da14736ca981aa40d1d8115f4bf2c2 [file] [log] [blame]
vishwabmcba0bd5f2015-09-30 16:50:23 +05301CXX ?= $(CROSS_COMPILE)g++
2
3DAEMON = ipmid
4DAEMON_OBJ = $(DAEMON).o
5LIB_OBJ = apphandler.o
6LIBS = libapphandler.so
7
Chris Austen0ba649e2015-10-13 12:28:13 -05008INC_FLAG += $(shell pkg-config --cflags --libs libsystemd) -I. -O2 --std=gnu++11
9LIB_FLAG += $(shell pkg-config --libs libsystemd) -rdynamic
vishwabmcba0bd5f2015-09-30 16:50:23 +053010IPMID_PATH ?= -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\"
11
12all: $(DAEMON) $(LIBS)
13
14%.o: %.C
15 $(CXX) -fpic -c $< $(CXXFLAGS) $(INC_FLAG) $(IPMID_PATH) -o $@
16
17$(LIBS): $(LIB_OBJ)
18 $(CXX) $^ -shared $(LDFLAGS) $(LIB_FLAG) -o $@
19
20$(DAEMON): $(DAEMON_OBJ)
21 $(CXX) $^ $(LDFLAGS) $(LIB_FLAG) -o $@ -ldl
22
23clean:
24 rm -f $(DAEMON) *.o *.so