Skip to content

Commit

Permalink
Add install shared libs
Browse files Browse the repository at this point in the history
  • Loading branch information
chuagao committed Sep 20, 2024
1 parent d262240 commit 10a77bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
CXX = g++
CXXFLAGS = -Wall -Wextra -pthread -O2 -fPIC -std=c++17

LIBNAME = commapiengine

INCLUDES = -Iinclude/private -Iinclude/comapi

PREFIX ?= /usr/local
LIBDIR = $(PREFIX)/lib64/comapi
INCLUDEDIR = $(PREFIX)/include/comapi

SRCS = src/event/epoll.cpp \
src/event/eventfd.cpp \
src/event/event.cpp \
Expand Down Expand Up @@ -47,6 +49,16 @@ src/%.o: src/%.cpp
@echo "Compiling $< into $@"
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

install: all
mkdir -p $(LIBDIR) $(INCLUDEDIR)
install -m 0755 $(SHARED_LIB) $(LIBDIR)
@echo "Installing header files to $(INCLUDEDIR)"
cp -r ./include/comapi/* $(INCLUDEDIR)

uninstall:
rm -f $(LIBDIR)/$(SHARED_LIB)
rm -rf $(INCLUDEDIR)/*

clean:
@echo "Cleaning up"
rm -f $(OBJS) $(SHARED_LIB)
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/pluginCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

using namespace commonApi;

#define COMMONAPI "/usr/lib/commonapi"
#define COMMON_API_PLUGINS "/usr/local/libexec/commonapi"

namespace
{
Expand Down Expand Up @@ -145,7 +145,7 @@ std::shared_ptr<Plugin> PluginCreator::create(const std::shared_ptr<Engine>& eng
std::cout << "No plugins found" << "COMAPI_PLUGINS_PATH_VAR_NAME" << std::endl;
}

auto ret = createFromDirectory(blacklist, COMMONAPI, engine, pluginTypeName, functionName, extraArgs);
auto ret = createFromDirectory(blacklist, COMMON_API_PLUGINS, engine, pluginTypeName, functionName, extraArgs);
engine->updatePluginMap(key, ret);

return ret;
Expand Down

0 comments on commit 10a77bb

Please sign in to comment.