LIBS=libconfuse nlohmann_json export version = 1.0.0 export soname_version = $(word 1, $(subst ., , $(version))) override CXXFLAGS += -MMD -Wall -std=c++20 `pkg-config $(LIBS) --cflags` override LDFLAGS += `pkg-config $(LIBS) --libs` SOURCES = $(wildcard src/*.cc) $(wildcard src/*/*.cc) OBJECTS = $(SOURCES:.cc=.o) DEPS = $(OBJECTS:.o=.d) EXECUTABLE = dmtool prefix ?= /usr exec_prefix ?= $(prefix) bindir ?= $(exec_prefix)/bin completions ?= `pkg-config --variable=completionsdir bash-completion` $(EXECUTABLE): $(OBJECTS) $(CXX) $(OBJECTS) -o $@ $(LDFLAGS) -include $(DEPS) parsed: parser/scrapeToJson.py parser/utils.py parser/verified.txt python parser/scrapeToJson.py touch parsed/ install: $(EXECUTABLE) install -d $(DESTDIR)$(prefix)/share/dmtool/ cp -r parsed/* $(DESTDIR)$(prefix)/share/dmtool/ install -d $(DESTDIR)$(bindir) install -m 755 $(EXECUTABLE) $(DESTDIR)$(bindir) install -d $(DESTDIR)$(completions) install -m 644 files/dmtool.bash $(DESTDIR)$(completions)/$(EXECUTABLE) install -m 644 files/dmtool.conf $(DESTDIR)/etc/dmtool.conf .PHONY: clean clean: $(RM) $(OBJECTS) $(DEPS) $(EXECUTABLE) test: $(foreach var,$(.VARIABLES),$(info $(var) = $($(var))))