-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (41 loc) · 1.96 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
57
DEBUGGING_FLAGS := -std=c99 -g -rdynamic -O0 -Werror -Wall -Wextra -Wno-missing-field-initializers -Wno-sign-compare -Wno-parentheses -Wno-missing-braces
RELEASE_FLAGS ?= -std=c99 -O3 -DNDEBUG -Werror -Wall -Wextra -Wno-missing-field-initializers -Wno-parentheses -Wno-missing-braces
CFLAGS ?= $(RELEASE_FLAGS)
LDFLAGS := -lm
SRC := gesture-event.c gestures-reader.c gestures-recorder.c
pkgname := sgestures
all: libsgestures.a sgestures-libinput-writer
install-headers:
install -m 0744 -Dt "$(DESTDIR)/usr/include/$(pkgname)/" *.h
install: install-headers sgestures-libinput-writer libsgestures.a sgestures.sh
install -m 0744 -Dt "$(DESTDIR)/usr/lib/" libsgestures.a
install -m 0755 -Dt "$(DESTDIR)/usr/bin/" sgestures-libinput-writer
install -m 0755 sgestures.sh "$(DESTDIR)/usr/bin/sgestures"
install -m 0755 -Dt "$(DESTDIR)/usr/share/sgestures/" sample-gesture-reader.c
uninstall:
rm -f "$(DESTDIR)/usr/lib/libsgestures.a"
rm -f "$(DESTDIR)/usr/bin/sgestures-libinput-writer"
rm -rdf "$(DESTDIR)/usr/include/$(pkgname)"
libsgestures.a: $(SRC:.c=.o)
ar rcs $@ $^
test: gesture-test libinput-gesture-test
./gesture-test
./libinput-gesture-test
sgestures-libinput-writer: gestures-libinput-writer.o
$(CC) $(CFLAGS) $^ -o $@ -linput -lm -ludev -levdev -lmtdev
gesture-test: CFLAGS := $(DEBUGGING_FLAGS)
gesture-test: gestures_unit.o $(SRC:.c=.o)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) -lscutest
libinput-gesture-test: CFLAGS := $(DEBUGGING_FLAGS)
libinput-gesture-test: $(SRC:.c=.o) libinput_gestures_unit.o gestures-libinput-writer.o
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) -lscutest -ludev -linput
sample-gesture-reader: CFLAGS := $(DEBUGGING_FLAGS)
sample-gesture-reader: sample-gesture-reader.o $(SRC:.c=.o)
$(CC) $(CFLAGS) $^ -o $@ -lm
debug: CFLAGS := $(DEBUGGING_FLAGS)
debug: sgestures-libinput-writer sample-gesture-reader
./sgestures-libinput-writer | ./sample-gesture-reader
clean:
rm -f *.o *.a *-test
.PHONY: clean install uninstall install-headers
.DELETE_ON_ERROR: