Cleanup install target

- rename MANPREFIX into MANDIR
- introduce variables BINDIR and MAN1DIR
- propagate DESTDIR in config.mk
- use install for installing files
This commit is contained in:
kai@dings.kai 2006-03-16 17:35:03 +02:00
parent 867ec641ec
commit f9f5866e5a
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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