From b5d0b495583e0ea6adfdfcce8a540a621d8c00c5 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 8 Jun 2020 06:57:51 +0000 Subject: Makefile: use config.mk for configuration, Makefile simplifications FossilOrigin-Name: 96e8a0a741fa029bca1eeeb36a2b8baf92a82022ce982ad30a9eb8e16c7153f4 --- Makefile | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3ea8f76..7a6a6a5 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,24 @@ -PREFIX = /usr/local -BINDIR = ${PREFIX}/bin -DOCDIR = ${PREFIX}/share/doc -KISSDOC = ${DOCDIR}/kiss -MANPREFIX = ${PREFIX}/share/man -MAN1 = ${MANPREFIX}/man1 -CC = cc +# See LICENSE for copyright information +include config.mk -all: kiss-stat kiss-readlink +BIN = bin/kiss-readlink bin/kiss-stat -kiss-stat: bin/kiss-stat.c - ${CC} -o kiss-stat bin/kiss-stat.c +all: ${BIN} -kiss-readlink: bin/kiss-readlink.c - ${CC} -o kiss-readlink bin/kiss-readlink.c +.c: + ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $< ${LIBS} clean: - rm -f kiss-stat kiss-readlink + rm -f ${BIN} install: all mkdir -p ${DESTDIR}${BINDIR} - cp -f kiss kiss-stat kiss-readlink ${DESTDIR}${BINDIR} - chmod 755 ${DESTDIR}${BINDIR}/kiss \ - ${DESTDIR}${BINDIR}/kiss-stat \ - ${DESTDIR}${BINDIR}/kiss-readlink + cp -f kiss ${BIN} ${DESTDIR}${BINDIR} + chmod 755 ${DESTDIR}${BINDIR}/kiss + for bin in ${BIN}; do chmod 755 ${DESTDIR}${BINDIR}/$${bin##*/}; done for bin in contrib/* ; do \ cp -f $${bin} ${DESTDIR}${BINDIR}/$${bin##*/}; \ chmod 755 ${DESTDIR}${BINDIR}/$${bin##*/} ; done - mkdir -p ${DESTDIR}${MAN1} for man in man/*.1 ; do cp -f $${man} ${DESTDIR}${MAN1}/$${man##*/}; \ chmod 644 ${DESTDIR}${MAN1}/$${man##*/} ; done @@ -39,7 +31,8 @@ uninstall: rm -f ${DESTDIR}${BINDIR}/kiss rm -f ${DESTDIR}${BINDIR}/kiss-stat rm -f ${DESTDIR}${BINDIR}/kiss-readlink - for bin in contrib/* ; do rm -f ${DESTDIR}${BINDIR}/$${bin##*/} ; done + for bin in ${BIN}; do rm -f ${DESTDIR}${BINDIR}/$${bin##*/}; done + for bin in contrib/*; do rm -f ${DESTDIR}${BINDIR}/$${bin##*/}; done rm -f ${DESTDIR}${MAN1}/kiss.1 ${DESTDIR}${MAN1}/kiss.1 rm -f ${DESTDIR}${MAN1}/kiss-contrib.1 ${DESTDIR}${MAN1}/kiss-contrib.1 rm -rf ${DESTDIR}${KISSDOC} -- cgit v1.2.3