diff options
Diffstat (limited to 'src/lib/Makefile')
-rw-r--r-- | src/lib/Makefile | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/Makefile b/src/lib/Makefile new file mode 100644 index 0000000..6b3b506 --- /dev/null +++ b/src/lib/Makefile @@ -0,0 +1,23 @@ +LIBS = sword minizip +override CXXFLAGS += -MMD -Wall -fPIC -std=c++20 `pkg-config $(LIBS) --cflags` +override LDFLAGS += -lstdc++fs `pkg-config $(LIBS) --libs` +SOURCES = $(wildcard *.cc) +OBJECTS = $(SOURCES:.cc=.o) +DEPS = $(OBJECTS:.o=.d) +LIBRARY = libbible +SONAME = $(LIBRARY).so.$(word 1, $(subst ., , $(version))) +LIBRARY_STATIC = $(LIBRARY).a +LIBRARY_SHARED = $(LIBRARY).so + +.PHONY: all +all: $(LIBRARY_SHARED) $(LIBRARY_STATIC) + +$(LIBRARY_SHARED): $(OBJECTS) + $(CXX) $^ -shared -Wl,-soname,$(SONAME) -o $@ $(LDFLAGS) + +$(LIBRARY_STATIC): $(OBJECTS) + $(AR) rcs $@ $^ + +.PHONY: clean +clean: + $(RM) $(OBJECTS) $(DEPS) $(LIBRARY_SHARED) $(LIBRARY_STATIC) |