summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-17 15:57:00 -0500
committerJune McEnroe <june@causal.agency>2019-01-17 15:57:00 -0500
commitb3381c53b0761284f86881e6780e04dcfb93d799 (patch)
tree7ce1c2969320726f9f0072a6dcd369915c5a909f /bin
parentReorganize bin and Makefile once again (diff)
downloadsrc-b3381c53b0761284f86881e6780e04dcfb93d799.tar.gz
src-b3381c53b0761284f86881e6780e04dcfb93d799.zip
Reunify gfx and bin
Diffstat (limited to '')
-rw-r--r--bin/.gitignore2
-rw-r--r--bin/Makefile26
-rw-r--r--bin/README10
-rw-r--r--bin/bin.722
-rw-r--r--bin/brot.c (renamed from gfx/brot.c)0
-rw-r--r--bin/gfx-cocoa.m (renamed from gfx/cocoa.m)0
-rw-r--r--bin/gfx-fb.c (renamed from gfx/fb.c)0
-rw-r--r--bin/gfx-x11.c (renamed from gfx/x11.c)0
-rw-r--r--bin/gfx.h (renamed from gfx/gfx.h)0
-rw-r--r--bin/gfxx.c (renamed from gfx/gfxx.c)0
-rw-r--r--bin/man1/brot.1 (renamed from gfx/man/brot.1)0
-rw-r--r--bin/man1/gfxx.1 (renamed from gfx/man/gfxx.1)0
12 files changed, 54 insertions, 6 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
index 5171e93d..b7d25952 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,9 +1,11 @@
 *.o
 atch
 bri
+brot
 dtch
 fbatt
 fbclock
+gfxx
 glitch
 hnel
 modem
diff --git a/bin/Makefile b/bin/Makefile
index 9ac12f16..655fc4e0 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,5 +1,11 @@
 PREFIX = ~/.local
 MANDIR = $(PREFIX)/share/man
+GFX = cocoa
+
+CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
+LDLIBS = -lm -lutil -lz
+LDLIBS_cocoa = $(LDLIBS) -framework Cocoa
+LDLIBS_x11 = $(LDLIBS) -lX11
 
 BINS += atch
 BINS += dtch
@@ -24,11 +30,13 @@ BINS_LINUX += fbatt
 BINS_LINUX += fbclock
 BINS_LINUX += psfed
 
-BINS_ALL = $(BINS) $(BINS_BSD) $(BINS_LINUX)
+BINS_GFX += brot
+BINS_GFX += gfxx
+
+BINS_ALL = $(BINS) $(BINS_BSD) $(BINS_LINUX) $(BINS_GFX)
 MAN1_ALL = $(BINS_ALL:%=man1/%.1)
 
-CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
-LDLIBS = -lm -lutil -lz
+GFX_OBJ = gfx-$(GFX).o
 
 any: .gitignore tags $(BINS)
 
@@ -36,19 +44,29 @@ bsd: any $(BINS_BSD)
 
 linux: any $(BINS_LINUX)
 
+gfx: any $(BINS_GFX)
+
 .o:
 	$(CC) $(LDFLAGS) $< $(LDLIBS) -o $@
 
 scheme.h: scheme
 	./scheme -c > scheme.h
 
+brot.o gfxx.o gfx-cocoa.o gfx-fb.o gfx-x11.o: gfx.h
+
 fbatt.o fbclock.o: scheme.h
 
-psf2png.o scheme.o: png.h
+gfxx.o psf2png.o scheme.o: png.h
 
 atch: dtch
 	ln -f dtch atch
 
+brot: brot.o $(GFX_OBJ)
+	$(CC) $(LDFLAGS) $@.o $(GFX_OBJ) $(LDLIBS_$(GFX)) -o $@
+
+gfxx: gfxx.o $(GFX_OBJ)
+	$(CC) $(LDFLAGS) $@.o $(GFX_OBJ) $(LDLIBS_$(GFX)) -o $@
+
 open pbcopy pbpaste: pbd
 	ln -f pbd $@
 
diff --git a/bin/README b/bin/README
index 0de6d849..a0353b53 100644
--- a/bin/README
+++ b/bin/README
@@ -8,9 +8,11 @@ DESCRIPTION
      target Linux.
 
      bri(1)      backlight brightness control
+     brot(1)     Mandelbrot renderer
      dtch(1)     detached sessions
      fbatt(1)    framebuffer battery indicator
      fbclock(1)  framebuffer clock
+     gfxx(1)     graphics data explorer
      glitch(1)   PNG glitcher
      hnel(1)     PTY input remapper
      modem(1)    fixed baud rate wrapper
@@ -23,4 +25,10 @@ DESCRIPTION
      wat(1)      watch files
      xx(1)       hexdump
 
-Causal Agency                  December 2, 2018                  Causal Agency
+     To build graphical tools, set one of:
+
+           GFX=cocoa
+           GFX=fb
+           GFX=x11
+
+Causal Agency                  January 17, 2019                  Causal Agency
diff --git a/bin/bin.7 b/bin/bin.7
index 4c5df7f0..c8b876a4 100644
--- a/bin/bin.7
+++ b/bin/bin.7
@@ -1,4 +1,4 @@
-.Dd December 2, 2018
+.Dd January 17, 2019
 .Dt BIN 7
 .Os "Causal Agency"
 .
@@ -19,6 +19,9 @@ Some tools target Linux.
 .It Xr bri 1
 backlight brightness control
 .
+.It Xr brot 1
+Mandelbrot renderer
+.
 .It Xr dtch 1
 detached sessions
 .
@@ -28,6 +31,9 @@ framebuffer battery indicator
 .It Xr fbclock 1
 framebuffer clock
 .
+.It Xr gfxx 1
+graphics data explorer
+.
 .It Xr glitch 1
 PNG glitcher
 .
@@ -61,3 +67,17 @@ watch files
 .It Xr xx 1
 hexdump
 .El
+.
+.Pp
+To build graphical tools,
+set one of:
+.
+.Pp
+.Bl -item -offset indent -compact
+.It
+.Va GFX Ns = Ns Cm cocoa
+.It
+.Va GFX Ns = Ns Cm fb
+.It
+.Va GFX Ns = Ns Cm x11
+.El
diff --git a/gfx/brot.c b/bin/brot.c
index 69f11e59..69f11e59 100644
--- a/gfx/brot.c
+++ b/bin/brot.c
diff --git a/gfx/cocoa.m b/bin/gfx-cocoa.m
index ce88dd78..ce88dd78 100644
--- a/gfx/cocoa.m
+++ b/bin/gfx-cocoa.m
diff --git a/gfx/fb.c b/bin/gfx-fb.c
index 0c4ddbf2..0c4ddbf2 100644
--- a/gfx/fb.c
+++ b/bin/gfx-fb.c
diff --git a/gfx/x11.c b/bin/gfx-x11.c
index 8a35364d..8a35364d 100644
--- a/gfx/x11.c
+++ b/bin/gfx-x11.c
diff --git a/gfx/gfx.h b/bin/gfx.h
index 2372c0f3..2372c0f3 100644
--- a/gfx/gfx.h
+++ b/bin/gfx.h
diff --git a/gfx/gfxx.c b/bin/gfxx.c
index 0e2a2f2a..0e2a2f2a 100644
--- a/gfx/gfxx.c
+++ b/bin/gfxx.c
diff --git a/gfx/man/brot.1 b/bin/man1/brot.1
index 7c1a4087..7c1a4087 100644
--- a/gfx/man/brot.1
+++ b/bin/man1/brot.1
diff --git a/gfx/man/gfxx.1 b/bin/man1/gfxx.1
index d3d1edbd..d3d1edbd 100644
--- a/gfx/man/gfxx.1
+++ b/bin/man1/gfxx.1