-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (41 loc) · 1.03 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
#
# Copyright (c) 2017 Gaël PORTAY <gael.portay@savoirfairelinux.com>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by the
# Free Software Foundation.
#
PREFIX ?= /usr/local
.PHONY: all
all:
.PHONY: doc
doc: protodec-c.1.gz
.PHONY: install
install:
install -d $(DESTDIR)$(PREFIX)/bin/
install -m 755 protodec-c $(DESTDIR)$(PREFIX)/bin/protodec-c
.PHONY: install-doc
install-doc:
install -d $(DESTDIR)$(PREFIX)/share/man/man1/
install -m 644 protodec-c.1.gz $(DESTDIR)$(PREFIX)/share/man/man1/
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/protodec-c
.PHONY: uninstall-doc
uninstall-doc:
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/protodec-c.1.gz
.PHONY: check
check: protodec-c
shellcheck $^
.PHONY: clean
clean:
rm -f protodec-c.1.gz
.PHONY: test
test: simple.pb-c.h
sed -nf protodec-c.sed $<
%.pb-c.h %.pb-c.c: %.proto
protoc-c --c_out=. $<
%.1: %.1.adoc
asciidoctor -b manpage -o $@ $<
%.gz: %
gzip -c $^ >$@