-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (41 loc) · 1016 Bytes
/
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
57
58
59
CPPFLAGS ?= -pedantic-errors -Wall
CFLAGS ?= -pipe -Wextra -O2
CPPFLAGS += -std=c99 -D_XOPEN_SOURCE=600 -ftabstop=4
everything: capture dump
capture: capture.c
dump: dump.c
%: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^
.c:
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $>
clean:
rm -f capture dump
PREFIX ?= usr
LIBDIR ?= lib
SYSTEMD_UNITDIR ?= $(LIBDIR)/systemd/system
bin := $(DESTDIR)/$(PREFIX)/bin
unit := $(DESTDIR)/$(SYSTEMD_UNITDIR)
env := $(DESTDIR)/etc/default
install: \
$(bin)/keystat-capture \
$(bin)/keystat-dump \
$(bin)/keystat-translate \
$(unit)/keystat.service \
$(env)/keystat
$(bin)/keystat-capture: capture $(bin)
cp -p $< $@
$(bin)/keystat-dump: dump $(bin)
cp -p $< $@
$(bin)/keystat-translate: translate.py $(bin)
cp -p $< $@
$(unit)/keystat.service: keystat.service $(unit)
cp -p $< $@
$(env)/keystat: keystat.env $(env)
cp -p $< $@
$(bin):
mkdir -p $@
$(unit):
mkdir -p $@
$(env):
mkdir -p $@
.PHONY: clean install