File: Makefile

package info (click to toggle)
senpai 0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,072 kB
  • sloc: makefile: 70
file content (68 lines) | stat: -rw-r--r-- 2,300 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
.POSIX:
.SUFFIXES:

GO ?= go
RM ?= rm
INSTALL ?= install
SCDOC ?= scdoc
GIT ?= git
GOFLAGS ?=
PREFIX ?= /usr/local
BINDIR ?= bin
MANDIR ?= share/man
APPDIR ?= share/applications
ICONDIR ?= share/icons

ifeq (0, $(shell $(GIT) status >/dev/null 2>&1; echo $$?))
export SOURCE_DATE_EPOCH ?= $(shell $(GIT) log -1 --pretty=%ct)
endif

all: senpai doc

senpai:
	$(GO) build $(GOFLAGS) ./cmd/senpai

ifeq (, $(shell which $(SCDOC) 2>/dev/null))
$(warning "$(SCDOC) not found, skipping building documentation")
doc:
else
doc: doc/senpai.1 doc/senpai.5
doc/senpai.1: doc/senpai.1.scd
	$(SCDOC) < doc/senpai.1.scd > doc/senpai.1
doc/senpai.5: doc/senpai.5.scd
	$(SCDOC) < doc/senpai.5.scd > doc/senpai.5
endif

res: res/icon.128.png res/icon.48.png
res/icon.128.png: res/icon.svg
	rsvg-convert -o res/icon.128.png res/icon.svg
res/icon.48.png: res/icon.svg
	rsvg-convert -w 48 -h 48 -o res/icon.48.png res/icon.svg

clean:
	$(RM) -rf senpai doc/senpai.1 doc/senpai.5
install:
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/$(BINDIR)
	$(INSTALL) senpai $(DESTDIR)$(PREFIX)/$(BINDIR)/senpai
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
	$(INSTALL) -m644 doc/senpai.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/senpai.1
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
	$(INSTALL) -m644 doc/senpai.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5/senpai.5
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/$(APPDIR)
	$(INSTALL) -m644 contrib/senpai.desktop $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps
	$(INSTALL) -m644 res/icon.48.png $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps/senpai.png
	$(INSTALL) -d $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps
	$(INSTALL) -m644 res/icon.svg $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps/senpai.svg
uninstall:
	$(RM) $(DESTDIR)$(PREFIX)/$(BINDIR)/senpai
	$(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/senpai.1
	$(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man5/senpai.5
	$(RM) $(DESTDIR)$(PREFIX)/$(APPDIR)/senpai.desktop
	$(RM) $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/48x48/apps/senpai.png
	$(RM) $(DESTDIR)$(PREFIX)/$(ICONDIR)/hicolor/scalable/apps/senpai.svg

emoji:
	curl -sSfL -o emoji.json "https://raw.githubusercontent.com/rhysd/gemoji/refs/heads/unicode-16.0/db/emoji.json"

.PHONY: all senpai doc res clean install uninstall emoji