summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-05-04 17:50:38 -0400
committerJune McEnroe <june@causal.agency>2019-05-04 17:50:38 -0400
commitd2a90f4df164c99a7156dc2385a2b9ebce45ee2d (patch)
treecdafff701a6aeddbe8737f1b40da761d64f9c044
parentAdd relay.1 (diff)
downloadsrc-d2a90f4df164c99a7156dc2385a2b9ebce45ee2d.tar.gz
src-d2a90f4df164c99a7156dc2385a2b9ebce45ee2d.zip
Move relay to bin
-rw-r--r--bin/.gitignore2
-rw-r--r--bin/Makefile41
-rw-r--r--bin/README3
-rw-r--r--bin/bin.75
-rw-r--r--bin/irc/.gitignore1
-rw-r--r--bin/irc/Makefile13
-rw-r--r--bin/man1/relay.1 (renamed from bin/irc/relay.1)0
-rw-r--r--bin/relay.c (renamed from bin/irc/relay.c)0
8 files changed, 37 insertions, 28 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
index 4e25a4fd..ce3a976f 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -5,6 +5,7 @@ atch
 beef
 bri
 brot
+config.mk
 dtch
 fbatt
 fbclock
@@ -20,6 +21,7 @@ pbpaste
 pngo
 psf2png
 psfed
+relay
 scheme
 scheme.h
 scheme.png
diff --git a/bin/Makefile b/bin/Makefile
index 16a5ba9e..528a70b2 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,13 +1,22 @@
-PREFIX = ~/.local
-MANDIR = $(PREFIX)/share/man
 GFX = cocoa
+LIBRESSL_PREFIX = /usr/local
+
+PREFIX = ~/.local
+MANIDR = $(PREFIX)/share/man
 
 CFLAGS += -Wall -Wextra -Wpedantic
 LDLIBS = -lm -lutil -lz
+
+CFLAGS_tls = $(CFLAGS) -I$(LIBRESSL_PREFIX)/include
+LDFLAGS_tls = $(LDFLAGS) -L$(LIBRESSL_PREFIX)/lib
+LDLIBS_tls = $(LDLIBS) -ltls
+
 LDLIBS_cocoa = $(LDLIBS) -framework Cocoa
 LDLIBS_fb = $(LDLIBS)
 LDLIBS_x11 = $(LDLIBS) -lX11
 
+-include config.mk
+
 BINS += aes
 BINS += dtch
 BINS += glitch
@@ -32,24 +41,28 @@ LINKS += pbpaste
 BINS_BSD += beef
 BINS_BSD += wat
 
+BINS_GFX += brot
+BINS_GFX += gfxx
+
 BINS_LINUX += bri
 BINS_LINUX += fbatt
 BINS_LINUX += fbclock
 BINS_LINUX += psfed
 
-BINS_GFX += brot
-BINS_GFX += gfxx
+BINS_TLS += relay
 
-BINS_ALL = $(BINS) $(BINS_BSD) $(BINS_LINUX) $(BINS_GFX)
+BINS_ALL = $(BINS) $(BINS_BSD) $(BINS_GFX) $(BINS_LINUX) $(BINS_TLS)
 MAN1_ALL = $(BINS_ALL:%=man1/%.1)
 
 any: .gitignore tags $(BINS) $(LINKS)
 
-bsd: any $(BINS_BSD)
+bsd: $(BINS_BSD)
+
+gfx: $(BINS_GFX)
 
-linux: any $(BINS_LINUX)
+linux: $(BINS_LINUX)
 
-gfx: any $(BINS_GFX)
+tls: $(BINS_TLS)
 
 .o:
 	$(CC) $(LDFLAGS) $< $(LDLIBS) -o $@
@@ -75,22 +88,26 @@ hi: hi.c
 	$(CC) $(CFLAGS) $(LDFLAGS) hi.c $(LDLIBS) -o $@
 	./hi -c
 
+relay: relay.c
+	$(CC) $(CFLAGS_tls) $(LDFLAGS_tls) relay.c $(LDLIBS_tls) -o $@
+
 atch: dtch
 	ln -f dtch atch
 
 open pbcopy pbpaste: pbd
 	ln -f pbd $@
 
-.gitignore: Makefile
-	echo $(BINS_ALL) $(LINKS) tags scheme.h scheme.png '*.o' '*.html' \
-		| tr ' ' '\n' | sort > .gitignore
-
 tags: *.h *.c
 	ctags -w *.h *.c
 
 scheme.png: scheme
 	./scheme -gt > scheme.png
 
+IGNORE = '*.o' '*.html' config.mk tags scheme.h scheme.png $(BINS_ALL) $(LINKS)
+
+.gitignore: Makefile
+	echo $(IGNORE) | tr ' ' '\n' | sort > .gitignore
+
 HTMLS = $(BINS_ALL:%=%.html)
 HTMLS += Makefile.html
 HTMLS += gfx-fb.html
diff --git a/bin/README b/bin/README
index bd12df94..d3d05ade 100644
--- a/bin/README
+++ b/bin/README
@@ -23,6 +23,7 @@ DESCRIPTION
      pngo(1)     PNG optimizer
      psf2png(1)  PSF2 to PNG renderer
      psfed(1)    PSF2 font editor
+     relay(1)    IRC relay
      scheme(1)   color scheme
      ttpre(1)    man output to HTML
      up(1)       upload file
@@ -36,4 +37,4 @@ DESCRIPTION
            GFX=fb
            GFX=x11
 
-Causal Agency                  Feburary 12, 2019                 Causal Agency
+Causal Agency                     May 4, 2019                    Causal Agency
diff --git a/bin/bin.7 b/bin/bin.7
index e6ab3cc0..0c7c3184 100644
--- a/bin/bin.7
+++ b/bin/bin.7
@@ -1,4 +1,4 @@
-.Dd Feburary 12, 2019
+.Dd May 4, 2019
 .Dt BIN 7
 .Os "Causal Agency"
 .
@@ -64,6 +64,9 @@ PSF2 to PNG renderer
 .It Xr psfed 1
 PSF2 font editor
 .
+.It Xr relay 1
+IRC relay
+.
 .It Xr scheme 1
 color scheme
 .
diff --git a/bin/irc/.gitignore b/bin/irc/.gitignore
deleted file mode 100644
index 32e541af..00000000
--- a/bin/irc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-relay
diff --git a/bin/irc/Makefile b/bin/irc/Makefile
deleted file mode 100644
index c909f067..00000000
--- a/bin/irc/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-LIBRESSL_PREFIX = /usr/local
-
-CFLAGS += -Wall -Wextra -Wpedantic
-CFLAGS += -I$(LIBRESSL_PREFIX)/include
-LDFLAGS += -L$(LIBRESSL_PREFIX)/lib
-LDLIBS = -ltls
-
--include config.mk
-
-relay:
-
-clean:
-	rm -f relay
diff --git a/bin/irc/relay.1 b/bin/man1/relay.1
index 402c4726..402c4726 100644
--- a/bin/irc/relay.1
+++ b/bin/man1/relay.1
diff --git a/bin/irc/relay.c b/bin/relay.c
index 7c70b4db..7c70b4db 100644
--- a/bin/irc/relay.c
+++ b/bin/relay.c