forked from jhawthorn/fzy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 799 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
VERSION=0.3
CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
CFLAGS+=-Wall -Wextra -g -std=c99 -O3 -pedantic
PREFIX?=/usr/local
MANDIR?=$(PREFIX)/share/man
BINDIR?=$(PREFIX)/bin
DEBUGGER?=
INSTALL=install
INSTALL_PROGRAM=$(INSTALL)
INSTALL_DATA=${INSTALL} -m 644
all: fzy
fzytest: fzytest.o match.o choices.o
$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
test: fzytest
$(DEBUGGER) ./fzytest
fzy: fzy.o match.o tty.o choices.o
$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
%.o: %.c config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
config.h:
cp config.def.h config.h
install: fzy
mkdir -p $(DESTDIR)$(BINDIR)
cp fzy $(DESTDIR)$(BINDIR)/
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp fzy.1 $(DESTDIR)$(MANDIR)/man1/
fmt:
clang-format -i *.c *.h
clean:
$(RM) fzy fzytest *.o
.PHONY: test all clean install fmt