Commit 24c4b045 authored by FRIGN's avatar FRIGN

Add tool manpages and set up the Makefile to install the manuals

While at it, refactor the makefile a bit.
parent ba154494
.Dd 2016-01-05
.Dt 2FF 1
.Os suckless.org
.Sh NAME
.Nm 2ff
.Nd convert image to farbfeld
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
reads an image from stdin, converts it to
.Xr farbfeld 5
and writes the result to stdout.
.Pp
.Nm
is a wrapper script around the *2ff-tools
with a soft fallback to obtaining a PNG from imagemagick's
.Xr convert 1
and passing it through
.Xr png2ff 1 .
.Pp
In case of an error
.Nm
writes a diagnostic message to stderr.
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 0
Image processed successfully.
.It 1
An error occurred or
.Xr convert 1
was not found in the fallback.
.El
.Sh EXAMPLES
$
.Nm
< image.* > image.ff
.Pp
$
.Nm
< image.* | bzip2 > image.ff.bz2
.Sh SEE ALSO
.Xr bunzip2 1 ,
.Xr bzip2 1 ,
.Xr convert 1 ,
.Xr ff2png 1 ,
.Xr jpg2ff 1 ,
.Xr png2ff 1 ,
.Xr farbfeld 5
.Sh AUTHORS
.An Laslo Hunhold Aq Mt dev@frign.de
......@@ -3,7 +3,10 @@
include config.mk
SRC = png2ff.c ff2png.c jpg2ff.c
BIN = png2ff ff2png jpg2ff
SRC = $(BIN:=.c)
MAN1 = 2ff.1 $(BIN:=.1)
MAN5 = farbfeld.5
all: png2ff ff2png jpg2ff
......@@ -12,16 +15,28 @@ all: png2ff ff2png jpg2ff
@${CC} -o $@ ${CFLAGS} ${LIBS} ${LDFLAGS} $<
clean:
rm -f png2ff ff2png jpg2ff
rm -f ${BIN}
install:
@echo installing into ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f jpg2ff png2ff ff2png 2ff ${DESTDIR}${PREFIX}/bin
@cp -f 2ff ${BIN} ${DESTDIR}${PREFIX}/bin
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
@cp -f $(MAN1) $(DESTDIR)$(MANPREFIX)/man1
cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN1)
mkdir -p $(DESTDIR)$(MANPREFIX)/man5
@cp -f $(MAN5) $(DESTDIR)$(MANPREFIX)/man5
cd $(DESTDIR)$(MANPREFIX)/man5 && chmod 644 $(MAN5)
uninstall:
@echo removing from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/png2ff
@rm -f ${DESTDIR}${PREFIX}/bin/ff2png
cd ${DESTDIR}${PREFIX}/bin
@rm -f 2ff ${BIN}
@echo removing from ${DESTDIR}${MANPREFIX}/man1
cd ${DESTDIR}${MANPREFIX}/man1
@rm -f $(MAN1)
@echo removing from ${DESTDIR}${MANPREFIX}/man5
cd ${DESTDIR}${MANPREFIX}/man5
@rm -f $(MAN5)
.PHONY: all clean install uninstall
.Dd 2016-01-05
.Dt FF2PNG 1
.Os suckless.org
.Sh NAME
.Nm ff2png
.Nd convert farbfeld to PNG
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
reads a
.Xr farbfeld 5
image from stdin, converts it to a 16-Bit RGBA PNG and writes the result
to stdout.
.Pp
In case of an error
.Nm
writes a diagnostic message to stderr.
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 0
Image processed successfully.
.It 1
An error occurred.
.El
.Sh EXAMPLES
$
.Nm
< image.ff > image.png
.Pp
$ bunzip2 < image.ff.bz2 |
.Nm
> image.png
.Sh SEE ALSO
.Xr 2ff 1 ,
.Xr bunzip2 1 ,
.Xr bzip2 1 ,
.Xr jpg2ff 1 ,
.Xr png2ff 1 ,
.Xr farbfeld 5
.Sh AUTHORS
.An Laslo Hunhold Aq Mt dev@frign.de
.Dd 2016-01-05
.Dt JPG2FF 1
.Os suckless.org
.Sh NAME
.Nm jpg2ff
.Nd convert JPG to farbfeld
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
reads a JPG image from stdin, converts it to
.Xr farbfeld 5
and writes the result to stdout.
.Pp
In case of an error
.Nm
writes a diagnostic message to stderr.
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 0
Image processed successfully.
.It 1
An error occurred.
.El
.Sh EXAMPLES
$
.Nm
< image.jpg > image.ff
.Pp
$
.Nm
< image.jpg | bzip2 > image.ff.bz2
.Sh SEE ALSO
.Xr 2ff 1 ,
.Xr bunzip2 1 ,
.Xr bzip2 1 ,
.Xr ff2png 1 ,
.Xr png2ff 1 ,
.Xr farbfeld 5
.Sh AUTHORS
.An Laslo Hunhold Aq Mt dev@frign.de
.Dd 2016-01-05
.Dt PNG2FF 1
.Os suckless.org
.Sh NAME
.Nm png2ff
.Nd convert PNG to farbfeld
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
reads a PNG image from stdin, converts it to
.Xr farbfeld 5
and writes the result to stdout.
.Pp
In case of an error
.Nm
writes a diagnostic message to stderr.
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 0
Image processed successfully.
.It 1
An error occurred.
.El
.Sh EXAMPLES
$
.Nm
< image.png > image.ff
.Pp
$
.Nm
< image.png | bzip2 > image.ff.bz2
.Sh SEE ALSO
.Xr 2ff 1 ,
.Xr bunzip2 1 ,
.Xr bzip2 1 ,
.Xr ff2png 1 ,
.Xr jpg2ff 1 ,
.Xr farbfeld 5
.Sh AUTHORS
.An Laslo Hunhold Aq Mt dev@frign.de
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment