Initial Commit

This commit is contained in:
2026-03-29 19:38:17 -07:00
commit 9a30e9b426
5 changed files with 293 additions and 0 deletions

45
Makefile Normal file
View File

@@ -0,0 +1,45 @@
CXX ?= g++
VERSION := 0.0.1
TARGET_NOVERSION := liboptions.so
TARGET := $(TARGET_NOVERSION).$(VERSION)
SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
CXXFLAGS := -std=c++17 -fPIC -shared
OPTFLAGS := -O3
DBGFLAGS := -g
LDFLAGS :=
# Default build
all: release
release: CXXFLAGS += $(OPTFLAGS)
release: $(TARGET)
debug: CXXFLAGS += $(DBGFLAGS)
debug: $(TARGET)
# Linker
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
# Compiler
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -f $(OBJS) $(TARGET_NOVERSION) $(TARGET_NOVERSION).*
install:
cp $(TARGET) /usr/lib/$(TARGET)
cp options.h /usr/include/options.h
ln -s /usr/lib/$(TARGET) /usr/lib/$(TARGET_NOVERSION)
uninstall:
unlink /usr/lib/$(TARGET_NOVERSION)
rm /usr/lib/$(TARGET)
rm /usr/include/options.h