blob: edb29e4b36d89c4cbcee03ae49c287d3c957b568 (
plain)
1 VERSION := 2.0
2 BINDIR := /usr/bin
3 MANDIR := /usr/share/man/man1
4 ETCDIR := /etc/revdep.d
5 CXXFLAGS ?= -O2
6 CXXFLAGS += -std=gnu++0x -Wall -Wextra -g -DVERSION='"$(VERSION)"'
7 LDFLAGS += -static $(shell pkg-config --libs --static libelf)
8 SOURCES := elf.cpp utility.cpp main.cpp pkg.cpp elf-cache.cpp
9 OBJECTS := $(patsubst %.cpp,%.o,$(SOURCES))
10
11 all: revdep revdep.1
12
13 install: all
14 install -d $(DESTDIR)$(BINDIR)
15 install -d $(DESTDIR)$(MANDIR)
16 install -d $(DESTDIR)$(ETCDIR)
17 install -m 0755 revdep $(DESTDIR)$(BINDIR)/
18 install -m 0644 revdep.1 $(DESTDIR)$(MANDIR)/
19
20 dist: revdep.1
21 git archive --format tar --prefix revdep-$(VERSION)/ HEAD | xz > revdep-$(VERSION).tar.xz
22
23 revdep: $(OBJECTS)
24 $(CXX) $(OBJECTS) $(LDFLAGS) -o revdep
25
26 revdep.1: revdep.man
27 txt2man revdep.man > revdep.1
28
29 clean:
30 $(RM) $(OBJECTS) revdep
|