export version = 1.0.1 override CXXFLAGS += -MMD -Wall -std=c++20 override LDFLAGS += -Lsrc/lib -lbible SOURCES = $(wildcard src/*.cc) OBJECTS = $(SOURCES:.cc=.o) DEPS = $(OBJECTS:.o=.d) EXECUTABLE = bible prefix ?= /usr exec_prefix ?= $(prefix) libdir ?= $(exec_prefix)/lib bindir ?= $(exec_prefix)/bin includedir ?= $(prefix)/include $(EXECUTABLE): $(OBJECTS) libbible $(CXX) $(OBJECTS) -o $@ $(LDFLAGS) -include $(DEPS) .PHONY: libbible libbible: $(MAKE) -C src/lib .PHONY: test test: libbible $(MAKE) -C src/test/ test install: libbible $(EXECUTABLE) install -d $(DESTDIR)$(libdir) install -m 644 src/lib/libbible.so $(DESTDIR)$(libdir)/libbible.so.$(version) install -m 644 src/lib/libbible.a $(DESTDIR)$(libdir) install -d $(DESTDIR)$(includedir) install -m 644 src/lib/libbible.h $(DESTDIR)$(includedir) install -d $(DESTDIR)$(bindir) install -m 755 $(EXECUTABLE) $(DESTDIR)$(bindir) install -d $(DESTDIR)`pkg-config --variable=completionsdir bash-completion` install -m 644 bible.bash $(DESTDIR)`pkg-config --variable=completionsdir bash-completion`/$(EXECUTABLE) .PHONY: clean clean: $(RM) $(OBJECTS) $(DEPS) $(EXECUTABLE) $(MAKE) -C src/test clean $(MAKE) -C src/lib clean