xcdat-Cwrapper/Makefile
hashirama 730f93b9c8
add nullptr to perform_search
we need a nullptr at the end, to show where the list ends.
2024-12-22 12:42:33 -04:00

27 lines
554 B
Makefile

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