-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (22 loc) · 796 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
__NAME__ = xpointerbarrier
CFLAGS += -std=c99 -Wall -Wextra -O2 `pkg-config --cflags x11 xfixes xrandr`
LDFLAGS += -lm `pkg-config --libs x11 xfixes xrandr`
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datarootdir = $(prefix)/share
mandir = $(datarootdir)/man
man1dir = $(mandir)/man1
.PHONY: clean install installdirs
$(__NAME__): $(__NAME__).c
$(CC) $(CFLAGS) $(LDFLAGS) -D__NAME__=\"$(__NAME__)\" -o $@ $< $(LDFLAGS)
clean:
rm -f $(__NAME__)
install: $(__NAME__) installdirs
$(INSTALL_PROGRAM) $(__NAME__) $(DESTDIR)$(bindir)/$(__NAME__)
$(INSTALL_DATA) man1/$(__NAME__).1 $(DESTDIR)$(man1dir)/$(__NAME__).1
installdirs:
mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)