logo

utils

~/.local/bin tools and git-hooks
commit: 448e258257054c81972dbfe017570c3e5fe82b0d
parent: c9cbad15b34d5e60588d97d5c0e19918a67943ee
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 21 Nov 2017 19:46:10 +0100

mkfile: Init

Finally something this isn’t ./make.sh

Diffstat:

Amkfile21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/mkfile b/mkfile @@ -0,0 +1,21 @@ +MKSHELL=/bin/sh +CC=cc +CFLAGS="-Wpedantic -Wall -Wextra -Wformat -O2 -std=c99 -Wno-unused -Werror=date-time" +PREFIX="/usr/local" +BINDIR=$PREFIX"/bin" +DOCDIR=$PREFIX"/share/doc/lanodan-utils" + +srcs=`cd src ; ls *.c` +bins=`echo $srcs | sed -r 's/\.c( )?/\1/g'` +docs="cd docs ; ls" + +all: $srcs + : +install: all + for i in $bins; do cp bin/$i $BINDIR/; done + for i in $docs; do cp docs/$i $DOCDIR/; done +clean: + cd bin + rm -v $bins +%.c: + $CC $CFLAGS -o bin/$stem src/$stem.c