blob: 4baf209a3a3987e255496d65d95523a7faa02d50 [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
8INC_FLAG += $(shell pkg-config --cflags glib-2.0 gio-unix-2.0) -I. -O2 --std=gnu++11
9LIB_FLAG += $(shell pkg-config --libs glib-2.0 gio-unix-2.0) -rdynamic
10IPMID_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