forked from sjmulder/trickle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (28 loc) · 935 Bytes
/
Makefile
File metadata and controls
37 lines (28 loc) · 935 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
37
DESTDIR ?=
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)/man
CFLAGS += -ansi -g
# for SIGWINCH and cfmakeraw()
CFLAGS += -D_BSD_SOURCE
# for nanosleep() on GNU
CFLAGS += -D_GNU_SOURCE
CFLAGS += -Wall -Wextra -pedantic
# required for BSD, glibc, musl; not macOS
LDLIBS_tritty = $(LDLIBS) -lutil
all: trickle tritty
clean:
rm -f trickle tritty
install: trickle tritty
install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(MANPREFIX)/man1
install -m755 trickle tritty $(DESTDIR)$(PREFIX)/bin/
install -m644 trickle.1 tritty.1 $(DESTDIR)$(MANPREFIX)/man1/
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/trickle
rm -f $(DESTDIR)$(PREFIX)/bin/tritty
rm -f $(DESTDIR)$(MANPREFIX)/man1/trickle.1
rm -f $(DESTDIR)$(MANPREFIX)/man1/tritty.1
trickle: trickle.c trickle.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
tritty: tritty.c trickle.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS_tritty)
.PHONY: all clean install uninstall