aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-05-20 14:23:09 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-05-20 14:23:09 +0200
commit9e3fcd953e7136b900d6aabafe1c64c083a927be (patch)
tree87d504609b5518e47a515b8d269143831b206e39 /Makefile
downloadttym-9e3fcd953e7136b900d6aabafe1c64c083a927be.tar.gz
ttym-9e3fcd953e7136b900d6aabafe1c64c083a927be.zip
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..fd103de
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+# ttym - terminal countdown / stopwatch
+# See LICENSE file for copyright and license details.
+.POSIX:
+
+include config.mk
+
+BIN = timer
+SRC = ttym.c
+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)
+
+distclean: clean
+ rm -f config.h
+
+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
+
+uninstall:
+ rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
+ rm -f $(DESTDIR)$(MANPREFIX)/man1/timer.1
+
+.PHONY: all clean distclean install uninstall