blob: 252a8df87f17609cb26b3cac617c68623e3183cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
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))))
|