git clone https://orangeshoelaces.net/git/tttm.git
Author: Vasily Kolobkov on 06/03/2016
Committer: Vasily Kolobkov on 06/03/2016
Add install and uninstall make targets
Makefile | 26 ++++++--
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 65338dc..fbb224b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,19 @@
-.SUFFIXES: .c .o
+CC ?= cc
+CFLAGS ?=
+PREFIX ?= /usr/local
+BINDIR ?= ${PREFIX}/bin
+MAN1DIR ?= ${PREFIX}/man/man1
-.c.o:
- ${CC} ${CFLAGS} -c $<
+TTTMSRC = tttm.c errors.c laxsrc.c parser.c imap.c
+TTTMOBJ = ${TTTMSRC:.c=.o}
PSHADESSRC = pshades.c errors.c laxsrc.c parser.c
PSHADESOBJ = ${PSHADESSRC:.c=.o}
-TTTMSRC = tttm.c errors.c laxsrc.c parser.c imap.c
-TTTMOBJ = ${TTTMSRC:.c=.o}
+.SUFFIXES: .c .o
+
+.c.o:
+ ${CC} ${CFLAGS} -c $<
all: tttm pshades
@@ -20,6 +26,14 @@ pshades: ${PSHADESOBJ}
clean:
rm -f tttm pshades ${TTTMOBJ} ${PSHADESOBJ}
+install: tttm
+ install -m 755 -D tttm ${BINDIR}
+ install -m 444 -D tttm.1 ${MAN1DIR}
+
+uninstall:
+ rm -f ${BINDIR}/tttm
+ rm -f ${MAN1DIR}/tttm.1
+
errors.o: errors.c errors.h
laxsrc.o: laxsrc.c errors.h laxsrc.h
@@ -32,4 +46,4 @@ pshades.o: pshades.c errors.h laxsrc.h parser.h
tttm.o: tttm.c errors.h laxsrc.h parser.h imap.h
-.PHONY: all
+.PHONY: all clean install uninstall