skroll

text scroller
git clone git://git.2f30.org/skroll
Log | Files | Refs | README | LICENSE

commit d6561c6325e60a026b5a2462675764e7af8dfa5c
parent 500beaf4df6c1e1ed6142da72b27737bc09cf2a0
Author: z3bra <willyatmailoodotorg>
Date:   Sat, 30 Jan 2016 00:03:08 +0100

Cleanup makefile for POSIX compliance

Diffstat:
MMakefile | 36+++++++++++-------------------------
Mskroll.c | 2+-
2 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,37 +1,23 @@ -PREFIX:=/usr -MANPREFIX:=${PREFIX}/share/man - CC = cc -LD= ${CC} -RM = rm -GZ = gzip -CFLAGS = -Wall -pedantic -LDFLAGS = - -.SUFFIXES: .c .o .gz -.PHONY : all clean install uninstall +LD = $(CC) -.c.o: - @echo -e "CC $<" - @${CC} -c ${CFLAGS} $< -o $@ +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man -skroll: skroll.o - @echo -e "LD skroll" - @${LD} $^ -o $@ ${LDFLAGS} +CFLAGS = -Wall -Wextra -pedantic +LDFLAGS = -skroll.1.gz: skroll.1 - @echo "GZ $<" - @${GZ} -c $< > $@ +.PHONY : clean install uninstall -all : skroll skroll.1.gz +skroll: skroll.o clean : - ${RM} -f skroll *.o *.gz *~ + rm -f skroll *.o -install: skroll skroll.1.gz +install: skroll skroll.1 install -D -m 0755 skroll ${DESTDIR}${PREFIX}/bin/skroll - install -D -m 0644 skroll.1.gz ${DESTDIR}${MANPREFIX}/man1/skroll.1.gz + install -D -m 0644 skroll.1 ${DESTDIR}${MANPREFIX}/man1/skroll.1 uninstall: ${RM} ${DESTDIR}${PREFIX}/bin/skroll - ${RM} ${DESTDIR}${MANPREFIX}/man1/skroll.1.gz + ${RM} ${DESTDIR}${MANPREFIX}/man1/skroll.1 diff --git a/skroll.c b/skroll.c @@ -62,7 +62,7 @@ void skroll (const char *input) /* flush stdout, and wait for the next step */ fflush(stdout); - /* decrease message's length when utf-8 chars disappear to the left */ + /* decrease length when utf-8 chars disappear to the left */ number -= utf8_len(input[offset]); offset += utf8_len(input[offset]);