ii

git clone https://orangeshoelaces.net/git/ii.git

f9f5866e5a1983958e5be1934c5a2db0d751c112

Author: kai@dings.kai on 03/16/2006

Committer: kai@dings.kai on 03/16/2006

Cleanup install target

- rename MANPREFIX into MANDIR
- introduce variables BINDIR and MAN1DIR
- propagate DESTDIR in config.mk
- use install for installing files

Stats

Makefile  | 13 +++-----
config.mk |  6 +++-
2 files changed, 10 insertions(+), 9 deletions(-)

Patch

diff --git a/Makefile b/Makefile
index 0f95412..8df535d 100644
--- a/Makefile
+++ b/Makefile
@@ -34,17 +34,14 @@ ii: ${OBJ}
 	@${CC} -o $@ ${OBJ} ${LDFLAGS}
 
 install: all
-	@mkdir -p ${DESTDIR}${PREFIX}/bin
-	@cp -f ii ${DESTDIR}${PREFIX}/bin
-	@chmod 755 ${DESTDIR}${PREFIX}/bin/ii
-	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
-	@cp -f ii.1 ${DESTDIR}${MANPREFIX}/man1
-	@chmod 444 ${DESTDIR}${MANPREFIX}/man1/ii.1
+	@install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MAN1DIR}
+	@install -m 775 ii ${DESTDIR}${BINDIR}
+	@install -m 444 ii.1 ${DESTDIR}${MAN1DIR}
 	@echo "installed ii"
 
 uninstall: all
-	rm -f ${DESTDIR}${MANPREFIX}/man1/ii.1
-	rm -f ${DESTDIR}${PREFIX}/bin/ii
+	rm -f ${DESTDIR}${MAN1DIR}/ii.1
+	rm -f ${DESTDIR}${BINDIR}/ii
 
 clean:
 	rm -f ii *~ *.o *core
diff --git a/config.mk b/config.mk
index 76219d9..cfc55d6 100644
--- a/config.mk
+++ b/config.mk
@@ -2,7 +2,11 @@
 
 # paths
 PREFIX      = /usr/local
-MANPREFIX   = ${PREFIX}/share/man
+BINDIR      = ${PREFIX}/bin		
+MANDIR      = ${PREFIX}/share/man
+MAN1DIR     = ${MANDIR}/man1
+# Set the following to install to a different root
+DESTDIR     =
 
 INCDIR      = ${PREFIX}/include
 LIBDIR      = ${PREFIX}/lib