
Specifically get the psql include path from pg_config as libpq-fe.h is in different places on RHEL-based and Debian-based systems. Also add -f to symlink command in install because we can't assume DEST_DIR is empty. This is in support of Austin's DevStack wirk in stx-config started in https://review.openstack.org/#/c/586443/, in my case because all of my DevStack VMs run Ubuntu xenial. Needed-by: https://review.openstack.org/595865 Change-Id: I8db0579225487e6b31fe8a5ed88a29820bda7d69 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
40 lines
1.6 KiB
Makefile
Executable File
40 lines
1.6 KiB
Makefile
Executable File
SRCS = fmAPI.cpp fmFile.cpp fmLog.cpp fmMsgServer.cpp fmMutex.cpp fmSocket.cpp fmThread.cpp fmTime.cpp \
|
|
fmAlarmUtils.cpp fmDb.cpp fmDbUtils.cpp fmDbAlarm.cpp fmSnmpUtils.cpp \
|
|
fmDbEventLog.cpp fmEventSuppression.cpp fmConfig.cpp
|
|
CLI_SRCS = fm_cli.cpp
|
|
OBJS = $(SRCS:.cpp=.o)
|
|
CLI_OBJS = fm_cli.o
|
|
LDLIBS = -lstdc++ -lrt -luuid -lpq -lpthread -lpython2.7
|
|
INCLUDES = -I./ -I$(shell pg_config --includedir)
|
|
CCFLAGS = -g -O2 -Wall -Werror -fPIC
|
|
|
|
LIBFMCOMMON_SO := libfmcommon.so
|
|
build: lib fmClientCli
|
|
|
|
.cpp.o:
|
|
$(CXX) $(CCFLAGS) $(INCLUDES) $(EXTRACCFLAGS) -c $< -o $@
|
|
|
|
lib: $(OBJS)
|
|
$(CXX) -Wl,-soname,$(LIBFMCOMMON_SO).$(MAJOR) -o $(LIBFMCOMMON_SO).$(MAJOR).$(MINOR) -shared $(OBJS) $(EXTRAARFLAGS) ${LDLIBS}
|
|
ln -sf $(LIBFMCOMMON_SO).$(MAJOR).$(MINOR) $(LIBFMCOMMON_SO).$(MAJOR)
|
|
ln -sf $(LIBFMCOMMON_SO).$(MAJOR).$(MINOR) $(LIBFMCOMMON_SO)
|
|
|
|
fmClientCli: $(CLI_OBJS) lib
|
|
$(CXX) -o $@ $(CLI_OBJS) -L./ -lfmcommon
|
|
|
|
clean:
|
|
@rm -f $(OBJ) *.o *.so fmClientCli
|
|
|
|
install_non_bb:
|
|
install -m 755 -d $(DEST_DIR)$(BIN_DIR)
|
|
install -m 755 -d $(DEST_DIR)$(LIB_DIR)
|
|
install -m 755 -d $(DEST_DIR)$(INC_DIR)
|
|
install -m 755 fmClientCli $(DEST_DIR)$(BIN_DIR)
|
|
install -m 644 fmDbAPI.h $(DEST_DIR)$(INC_DIR)
|
|
install -m 644 fmAPI.h $(DEST_DIR)$(INC_DIR)
|
|
install -m 644 fmThread.h $(DEST_DIR)$(INC_DIR)
|
|
install -m 644 fmAlarm.h $(DEST_DIR)$(INC_DIR)
|
|
install -m 755 $(LIBFMCOMMON_SO).$(MAJOR).$(MINOR) $(DEST_DIR)$(LIB_DIR)
|
|
ln -sf $(LIBFMCOMMON_SO).$(MAJOR).$(MINOR) $(DEST_DIR)$(LIB_DIR)/$(LIBFMCOMMON_SO).$(MAJOR)
|
|
ln -sf $(LIBFMCOMMON_SO).$(MAJOR).$(MINOR) $(DEST_DIR)$(LIB_DIR)/$(LIBFMCOMMON_SO)
|