blob: ee1751773395e9f42f871139e4cae7a8389108a2 (
plain) (
blame)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# ttym - terminal countdown / stopwatch
# See LICENSE file for copyright and license details.
.POSIX:
include config.mk
BIN = timer
SRC = ttym.c
HOOKS = hooks/on_start hooks/on_done hooks/on_quit
OBJ = $(SRC:.c=.o)
HDR = config.h
all: $(BIN)
config.h:
cp config.def.h $@
.c.o:
$(CC) -c $(CFLAGS) $<
$(OBJ): $(HDR) config.mk
$(BIN): $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS)
clean:
rm -f $(BIN) $(OBJ) ttym-$(VERSION).tar.gz
distclean: clean
rm -f config.h
dist: clean
mkdir -p ttym-$(VERSION)
cp -R LICENSE Makefile README.md config.def.h config.mk timer.1 ttym.c \
patches hooks ttym-$(VERSION)
tar -cf ttym-$(VERSION).tar ttym-$(VERSION)
gzip ttym-$(VERSION).tar
rm -rf ttym-$(VERSION)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin/$(BIN)
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BIN)
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
cp -f timer.1 $(DESTDIR)$(MANPREFIX)/man1/timer.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/timer.1
mkdir -p $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks
cp -f $(HOOKS) $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks
chmod 755 $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks/on_start
chmod 755 $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks/on_done
chmod 755 $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks/on_quit
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
rm -f $(DESTDIR)$(MANPREFIX)/man1/timer.1
rm -f $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks/on_start
rm -f $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks/on_done
rm -f $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks/on_quit
rmdir $(DESTDIR)$(PREFIX)/share/doc/ttym/hooks 2>/dev/null || true
rmdir $(DESTDIR)$(PREFIX)/share/doc/ttym 2>/dev/null || true
.PHONY: all clean distclean dist install uninstall
|