-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (42 loc) · 1.28 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# sdvt
#
PREFIX ?= /usr/local
MANPREFIX = ${PREFIX}/share/man
CFLAGS += -Wall -Werror -Wextra -pedantic -Wno-unused-parameter -Wno-error=deprecated-declarations -std=c99
#CPPFLAGS += -DPREFIX=\"$(PREFIX)\"
#CC = cc
PKG_MODULES := vte-2.90 gtk+-3.0
PKG_CFLAGS := $(shell pkg-config --cflags $(PKG_MODULES))
PKG_LDLIBS := $(shell pkg-config --libs $(PKG_MODULES))
ifeq ($(origin VER), command line)
VERSION := $(VER)
else
VERSION := $(shell git describe --abbrev=4 --dirty --always)
endif
CFLAGS += -DVERSION=\"$(VERSION)\"
all: sdvt sdvt.1
sdvt: CFLAGS += $(PKG_CFLAGS)
sdvt: LDLIBS += $(PKG_LDLIBS)
sdvt: sdvt.o
%: %.o
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
sdvt.1: sdvt.rst
rst2man $< $@
clean:
$(RM) sdvt sdvt.o
install: all
install -m 755 -d $(DESTDIR)$(PREFIX)/bin
install -m 755 -t $(DESTDIR)$(PREFIX)/bin sdvt
install -m 755 -d $(DESTDIR)$(MANPREFIX)/man1
install -m 644 -t $(DESTDIR)$(MANPREFIX)/man1 sdvt.1
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/sdvt
$(RM) $(DESTDIR)$(MANPREFIX)/man1/sdvt.1
dist:
ifeq ($(strip $(VERSION)),)
@echo "ERROR: Impossible to get a version from Git (or specify VER at the as a command line parameter of 'make')."
else
git archive --prefix=sdvt-$(VERSION)/ $(VERSION) | xz -c > sdvt-$(VERSION).tar.xz
endif
.PHONY: clean install uninstall dist