vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame^] | 1 | CXX ?= $(CROSS_COMPILE)g++ |
| 2 | |
| 3 | DAEMON = ipmid |
| 4 | DAEMON_OBJ = $(DAEMON).o |
| 5 | LIB_OBJ = apphandler.o |
| 6 | LIBS = libapphandler.so |
| 7 | |
| 8 | INC_FLAG += $(shell pkg-config --cflags glib-2.0 gio-unix-2.0) -I. -O2 --std=gnu++11 |
| 9 | LIB_FLAG += $(shell pkg-config --libs glib-2.0 gio-unix-2.0) -rdynamic |
| 10 | IPMID_PATH ?= -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\" |
| 11 | |
| 12 | all: $(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 | |
| 23 | clean: |
| 24 | rm -f $(DAEMON) *.o *.so |