graphcurses

Curses 2D graph generator
git clone git://git.christosmarg.xyz/graphcurses.git
Log | Files | Refs | README | LICENSE

commit 3e98a7955dda9f0a1bad746f2b64b427b13d3c85
parent 7a7b0064282012b506b69e86421e1275e5f7b149
Author: Christos Margiolis <christos@margiolis.net>
Date:   Wed, 21 Oct 2020 04:12:42 +0300

added POSIX Makefile

Diffstat:
MMakefile | 54+++++++++++++++++++++++++++++-------------------------
Mgraphcurses.c | 2+-
2 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,4 +1,6 @@ # See LICENSE file for copyright and license details. +# graphcurses - an ncurses 2D graph generator +.POSIX: BIN = graphcurses VERSION = 0.1 @@ -8,9 +10,11 @@ PREFIX = /usr/local MAN_DIR = ${PREFIX}/man/man1 BIN_DIR = ${PREFIX}/bin -EXT = c -SRC = ${wildcard *.${EXT}} -OBJ = ${SRC:%.${EXT}=%.o} +#EXT = c +#SRC = ${wildcard *.${EXT}} +#OBJ = ${SRC:%.${EXT}=%.o} +SRC = graphcurses.c +OBJ = graphcurses.o CC = gcc INCS = -Iinclude @@ -28,41 +32,41 @@ GZIP = gzip all: options ${BIN} options: - @echo ${BIN} build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" + @echo ${BIN} build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" ${BIN}: ${OBJ} - ${CC} ${LDFLAGS} $^ -o $@ + ${CC} ${LDFLAGS} ${OBJ} -o $@ ${OBJ}: ${SRC} - ${CC} ${CFLAGS} -c $< -o $@ + ${CC} ${CFLAGS} -c ${SRC} -o $@ dist: clean - ${MKDIR} ${DIST} - ${CP} -R ${SRC} LICENSE Makefile README.md ${DIST} - ${TAR} ${DIST}.tar ${DIST} - ${GZIP} ${DIST}.tar - ${RM_DIR} ${DIST} + ${MKDIR} ${DIST} + ${CP} -R ${SRC} LICENSE Makefile README.md ${DIST} + ${TAR} ${DIST}.tar ${DIST} + ${GZIP} ${DIST}.tar + ${RM_DIR} ${DIST} run: - ./${BIN} + ./${BIN} install: all - #${MKDIR} ${DESTDIR}${BIN_DIR} ${DESTDIR}${MAN_DIR} - ${MKDIR} ${DESTDIR}${BIN_DIR} - ${CP} ${BIN} ${BIN_DIR} - #${CP} ${MAN1} ${DESTDIR}${MAN_DIR} - #sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MAN_DIR}/${MAN1} - chmod 755 ${DESTDIR}${BIN_DIR}/${BIN} - #chmod 644 ${DESTDIR}${MAN_DIR}/${MAN1} + #${MKDIR} ${DESTDIR}${BIN_DIR} ${DESTDIR}${MAN_DIR} + ${MKDIR} ${DESTDIR}${BIN_DIR} + ${CP} ${BIN} ${BIN_DIR} + #${CP} ${MAN1} ${DESTDIR}${MAN_DIR} + #sed "s/VERSION/${VERSION}/g" < ${MAN1} > ${DESTDIR}${MAN_DIR}/${MAN1} + chmod 755 ${DESTDIR}${BIN_DIR}/${BIN} + #chmod 644 ${DESTDIR}${MAN_DIR}/${MAN1} uninstall: - ${RM} ${DESTDIR}${BIN_DIR}/${BIN} - #${RM} ${DESTDIR}${MAN_DIR}/${MAN1} + ${RM} ${DESTDIR}${BIN_DIR}/${BIN} + #${RM} ${DESTDIR}${MAN_DIR}/${MAN1} clean: - ${RM} ${BIN} ${OBJ} ${DIST}.tar.gz + ${RM} ${BIN} ${OBJ} ${DIST}.tar.gz .PHONY: all options clean dist install uninstall run diff --git a/graphcurses.c b/graphcurses.c @@ -259,7 +259,7 @@ graph_plot(const struct Plane *p, float x, float y) void menu_options(void) { - int w, h, wy, wh; + int w, h, wy, wx; WINDOW *opts; w = 33;