summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-07-30 15:14:49 -0400
committerJune McEnroe <june@causal.agency>2018-07-30 15:14:49 -0400
commit7538237e9cc26f788ba0fd65c97019ef250b5004 (patch)
tree363688af89b8c4df7040dcfd116f34f4a0771cee
parentAdd Neckbeard Deathcamp (diff)
downloadsrc-7538237e9cc26f788ba0fd65c97019ef250b5004.tar.gz
src-7538237e9cc26f788ba0fd65c97019ef250b5004.zip
Move graphical programs out of bin
I wonder when the last time was something needed -ledit...
Diffstat (limited to '')
-rw-r--r--bin/.gitignore3
-rw-r--r--bin/Makefile17
-rw-r--r--bin/gfx/none.c24
-rw-r--r--gfx/.gitignore4
-rw-r--r--gfx/Makefile31
-rw-r--r--gfx/brot.c (renamed from bin/brot.c)2
-rw-r--r--gfx/cocoa.m (renamed from bin/gfx/cocoa.m)0
-rw-r--r--gfx/fb.c (renamed from bin/gfx/fb.c)0
-rw-r--r--gfx/gfx.h (renamed from bin/gfx/gfx.h)0
-rw-r--r--gfx/gfxx.c (renamed from bin/gfxx.c)2
-rw-r--r--gfx/x11.c (renamed from bin/gfx/x11.c)0
11 files changed, 41 insertions, 42 deletions
diff --git a/bin/.gitignore b/bin/.gitignore
index 4e9c104e..6dfe7457 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,9 +1,6 @@
-*.o
 tags
 atch
-brot
 dtch
-gfxx
 glitch
 hnel
 modem
diff --git a/bin/Makefile b/bin/Makefile
index 9f913e47..ae667eef 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,13 +1,10 @@
-ANY_BINS = atch brot dtch gfxx glitch hnel modem pbcopy pbd pbpaste pngo scheme wake xx
+ANY_BINS = atch dtch glitch hnel modem pbcopy pbd pbpaste pngo scheme wake xx
 BSD_BINS = klon watch
 LIN_BINS = bri fbatt fbclock
 ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(LIN_BINS)
-GFX ?= none
 
 CFLAGS += -Wall -Wextra -Wpedantic
-LDLIBS = -lcurses -ledit -lm -lutil -lz
-LDLIBS_cocoa = -framework Cocoa
-LDLIBS_x11 = -lX11
+LDLIBS = -lcurses -lm -lutil -lz
 
 any: .gitignore tags $(ANY_BINS)
 
@@ -16,7 +13,7 @@ bsd: any $(BSD_BINS)
 linux: any $(LIN_BINS)
 
 .gitignore: Makefile
-	echo '*.o' tags $(ALL_BINS) scheme.png | tr ' ' '\n' > .gitignore
+	echo tags $(ALL_BINS) scheme.png | tr ' ' '\n' > .gitignore
 
 tags: *.c
 	ctags -w *.c
@@ -24,12 +21,6 @@ tags: *.c
 atch: dtch
 	ln -f dtch atch
 
-brot: brot.o gfx/$(GFX).o
-	$(CC) $(LDFLAGS) brot.o gfx/$(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
-
-gfxx: gfxx.o gfx/$(GFX).o
-	$(CC) $(LDFLAGS) gfxx.o gfx/$(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
-
 pbcopy pbpaste: pbd
 	ln -f pbd $@
 
@@ -41,7 +32,7 @@ setuid: bri
 	chmod u+s bri
 
 clean:
-	rm -f tags *.o gfx/*.o $(ALL_BINS)
+	rm -f tags $(ALL_BINS)
 
 link:
 	mkdir -p ~/.local/bin
diff --git a/bin/gfx/none.c b/bin/gfx/none.c
deleted file mode 100644
index 31de2ff4..00000000
--- a/bin/gfx/none.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 2018, June McEnroe <programble@gmail.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <err.h>
-#include <sysexits.h>
-
-#include "gfx.h"
-
-int main() {
-	errx(EX_CONFIG, "no gfx frontend");
-}
diff --git a/gfx/.gitignore b/gfx/.gitignore
new file mode 100644
index 00000000..cdff2c2e
--- /dev/null
+++ b/gfx/.gitignore
@@ -0,0 +1,4 @@
+*.o
+tags
+brot
+gfxx
diff --git a/gfx/Makefile b/gfx/Makefile
new file mode 100644
index 00000000..f2ae4bee
--- /dev/null
+++ b/gfx/Makefile
@@ -0,0 +1,31 @@
+BINS = brot gfxx
+GFX ?= cocoa
+
+CFLAGS += -Wall -Wextra -Wpedantic
+LDLIBS = -lm -lz
+LDLIBS_cocoa = -framework Cocoa
+LDLIBS_x11 = -lX11
+
+all: .gitignore tags $(BINS)
+
+.gitignore: Makefile
+	echo '*.o' tags $(BINS) | tr ' ' '\n' > .gitignore
+
+tags: *.h *.c
+	ctags -w *.h *.c
+
+brot: brot.o $(GFX).o
+	$(CC) $(LDFLAGS) brot.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
+
+gfxx: gfxx.o $(GFX).o
+	$(CC) $(LDFLAGS) gfxx.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
+
+clean:
+	rm -f tags *.o $(BINS)
+
+link:
+	mkdir -p ~/.local/bin
+	ln -s -f $(BINS:%=$(PWD)/%) ~/.local/bin
+
+unlink:
+	rm -f $(BINS:%=~/.local/bin/%)
diff --git a/bin/brot.c b/gfx/brot.c
index cd520cb9..64efde4b 100644
--- a/bin/brot.c
+++ b/gfx/brot.c
@@ -26,7 +26,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "gfx/gfx.h"
+#include "gfx.h"
 
 #define RGB(r, g, b) ((uint32_t)(r) << 16 | (uint32_t)(g) << 8 | (uint32_t)(b))
 #define GRAY(n) RGB(n, n, n)
diff --git a/bin/gfx/cocoa.m b/gfx/cocoa.m
index 3df6c62a..3df6c62a 100644
--- a/bin/gfx/cocoa.m
+++ b/gfx/cocoa.m
diff --git a/bin/gfx/fb.c b/gfx/fb.c
index e1ef5e82..e1ef5e82 100644
--- a/bin/gfx/fb.c
+++ b/gfx/fb.c
diff --git a/bin/gfx/gfx.h b/gfx/gfx.h
index 715ec08c..715ec08c 100644
--- a/bin/gfx/gfx.h
+++ b/gfx/gfx.h
diff --git a/bin/gfxx.c b/gfx/gfxx.c
index 4f67318c..576e895d 100644
--- a/bin/gfxx.c
+++ b/gfx/gfxx.c
@@ -29,7 +29,7 @@
 #include <unistd.h>
 #include <zlib.h>
 
-#include "gfx/gfx.h"
+#include "gfx.h"
 
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #define MASK(b) ((1 << (b)) - 1)
diff --git a/bin/gfx/x11.c b/gfx/x11.c
index eae926c2..eae926c2 100644
--- a/bin/gfx/x11.c
+++ b/gfx/x11.c