-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 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
PACKAGE ?= cursedeyes
VERSION ?= $(shell hg log --template '{latesttag}-{latesttagdistance}-{node|short} ({date|rfc3339date})' -r . || echo unknown)
PROGRAM = cursedeyes
SOURCES = cursedeyes.c
CC ?= gcc
CFLAGS ?= -g -O2
CFLAGS += -std=c99 -Wall -Wextra -pedantic
CFLAGS += $(shell pkg-config ncursesw --cflags)
CPPFLAGS += -D_POSIX_C_SOURCE=200809L
LDLIBS += -lm $(shell pkg-config ncursesw --libs)
INSTALL = install
INSTALL_BIN = $(INSTALL) -D -m 755
PREFIX = /usr/local
bin_dir = $(PREFIX)/bin
CPPFLAGS += -DPREFIX=$(PREFIX) \
-DPACKAGE=$(PACKAGE) \
-DPROGRAM=$(PROGRAM) \
-DVERSION='$(VERSION)'
all: $(PROGRAM)
.PHONY: all
$(PROGRAM): $(SOURCES)
clean:
$(RM) *.o
.PHONY: clean
clobber: clean
$(RM) $(PROGRAM)
.PHONY: clobber
install: $(PROGRAM)
$(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(bin_dir)/$(PROGRAM)
.PHONY: install
install-strip:
$(MAKE) INSTALL_BIN='$(INSTALL_BIN) -s' install
.PHONY: install-strip
uninstall:
$(RM) $(DESTDIR)$(bin_dir)/$(PROGRAM)
.PHONY: uninstall