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} @${CC} -o $@ ${OBJ} ${LDFLAGS}
install: all install: all
@mkdir -p ${DESTDIR}${PREFIX}/bin @install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MAN1DIR}
@cp -f ii ${DESTDIR}${PREFIX}/bin @install -m 775 ii ${DESTDIR}${BINDIR}
@chmod 755 ${DESTDIR}${PREFIX}/bin/ii @install -m 444 ii.1 ${DESTDIR}${MAN1DIR}
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@cp -f ii.1 ${DESTDIR}${MANPREFIX}/man1
@chmod 444 ${DESTDIR}${MANPREFIX}/man1/ii.1
@echo "installed ii" @echo "installed ii"
uninstall: all uninstall: all
rm -f ${DESTDIR}${MANPREFIX}/man1/ii.1 rm -f ${DESTDIR}${MAN1DIR}/ii.1
rm -f ${DESTDIR}${PREFIX}/bin/ii rm -f ${DESTDIR}${BINDIR}/ii
clean: clean:
rm -f ii *~ *.o *core rm -f ii *~ *.o *core

View File

@ -2,7 +2,11 @@
# paths # paths
PREFIX = /usr/local 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 INCDIR = ${PREFIX}/include
LIBDIR = ${PREFIX}/lib LIBDIR = ${PREFIX}/lib