CXX = g++ CC = gcc CXXFLAGS = -shared -fPIC LDFLAGS = -L. -ltrie_loader -Wl,-rpath=. # Paths and files LIBRARY_NAME = libtrie_loader.so EXECUTABLE_NAME = wrapper_executable SRC_CPP = libtrie_loader.cpp SRC_C = main.c # Targets all: $(EXECUTABLE_NAME) # Rule to build the shared library $(LIBRARY_NAME): $(SRC_CPP) $(CXX) $(CXXFLAGS) -o $@ $^ # Rule to build the executable from the C source $(EXECUTABLE_NAME): $(SRC_C) $(LIBRARY_NAME) $(CC) $(SRC_C) -o $@ $(LDFLAGS) # Clean up clean: rm -f $(LIBRARY_NAME) $(EXECUTABLE_NAME) .PHONY: all clean