cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 8ef092d8a9c026ade9dd7bb3787d6215ee94243a
parent e5aa04af2ceb59acf7f8a8fc5892a6524750a516
Author: Cem Keylan <cem@ckyln.com>
Date:   Mon,  8 Jun 2020 09:57:52 +0300

Makefile: use config.mk for configuration, Makefile simplifications

Diffstat:
MMakefile | 31++++++++++++-------------------
Aconfig.mk | 19+++++++++++++++++++
2 files changed, 31 insertions(+), 19 deletions(-)

diff --git 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} diff --git a/config.mk b/config.mk @@ -0,0 +1,19 @@ +# See LICENSE for copyright information + +# Paths +PREFIX = /usr/local +BINDIR = ${PREFIX}/bin +SHAREDIR = ${PREFIX}/share +DOCDIR = ${SHAREDIR}/doc +KISSDOC = ${DOCDIR}/kiss +MANPREFIX = ${SHAREDIR}/man +MAN1 = ${MANPREFIX}/man1 + +# Flags +CFLAGS = -std=c99 -Wpedantic -Wall -Os +LDFLAGS = -s -static +LIBS = -lc + +# C compiler and linker +CC = cc +LD = ${CC}