Makefile: add install and uninstall rule, remove TODO - sub - subscene.com subtitle search
(HTM) git clone git://git.codemadness.org/sub
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 0949ea1b085c5a0cd8194f829f57062f473481db
(DIR) parent eca3be95a8429e72bea2b29251e31d708208e346
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 4 May 2018 17:39:37 +0200
Makefile: add install and uninstall rule, remove TODO
Diffstat:
M Makefile | 23 ++++++++++++++++++++---
D TODO | 1 -
2 files changed, 20 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
@@ -1,6 +1,23 @@
+PREFIX = /usr/local
+
+BIN = sub
+SCRIPTS = \
+ sub-dl \
+ sub-search
+
+all: build
+
build: clean
- cc -c xml.c util.c sub.c ${CFLAGS}
- cc -o sub xml.o util.o sub.o ${LDFLAGS}
+ $(CC) -c xml.c util.c sub.c ${CFLAGS}
+ $(CC) -o $(BIN) xml.o util.o sub.o ${LDFLAGS}
clean:
- rm -f sub *.o
+ rm -f $(BIN) *.o
+
+install: all
+ mkdir -p "${DESTDIR}${PREFIX}/bin"
+ cp -f ${BIN} ${SCRIPTS} "${DESTDIR}${PREFIX}/bin"
+ for f in $(BIN) $(SCRIPTS); do chmod 755 "${DESTDIR}${PREFIX}/bin/$$f"; done
+
+uninstall:
+ for f in $(BIN) $(SCRIPTS); do rm -f "${DESTDIR}${PREFIX}/bin/$$f"; done
(DIR) diff --git a/TODO b/TODO
@@ -1 +0,0 @@
-- suckless Makefile