-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 754 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (26 loc) · 754 Bytes
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
CC ?= cc
CFLAGS ?= -O2 -Wall -Wextra -std=c11
PKG_CFLAGS := $(shell pkg-config --cflags xkbcommon 2>/dev/null)
PKG_LIBS := $(shell pkg-config --libs xkbcommon 2>/dev/null)
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SRC := $(wildcard src/*.c)
OBJ := $(SRC:.c=.o)
BIN := scribe-tap
.PHONY: all clean install uninstall bench
all: $(BIN)
check: $(BIN)
python3 tests/test_basic.py
$(BIN): $(OBJ)
$(CC) $(CFLAGS) -pthread -o $@ $^ $(PKG_LIBS)
src/%.o: src/%.c
$(CC) $(CFLAGS) $(PKG_CFLAGS) -pthread -Isrc -Iinclude -c -o $@ $<
clean:
rm -f $(OBJ) $(BIN)
install: $(BIN)
install -d $(DESTDIR)$(BINDIR)
install -m 0755 $(BIN) $(DESTDIR)$(BINDIR)/$(BIN)
uninstall:
rm -f $(DESTDIR)$(BINDIR)/$(BIN)
bench: $(BIN)
python3 tools/bench.py