summary refs log tree commit diff
path: root/gfx
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
commit41ca10496fd7b295acd23f8462c388dd03999344 (patch)
tree0740757391b2000469f9c3d3f45543aa92061f0b /gfx
parentAdd Neckbeard Deathcamp (diff)
downloadsrc-41ca10496fd7b295acd23f8462c388dd03999344.tar.gz
src-41ca10496fd7b295acd23f8462c388dd03999344.zip
Move graphical programs out of bin
I wonder when the last time was something needed -ledit...
Diffstat (limited to '')
-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
8 files changed, 37 insertions, 2 deletions
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 576ca770..cfa2ebfb 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 6c0f0d66..6c0f0d66 100644
--- a/bin/gfx/cocoa.m
+++ b/gfx/cocoa.m
diff --git a/bin/gfx/fb.c b/gfx/fb.c
index 7ee5fea1..7ee5fea1 100644
--- a/bin/gfx/fb.c
+++ b/gfx/fb.c
diff --git a/bin/gfx/gfx.h b/gfx/gfx.h
index cd59ea3d..cd59ea3d 100644
--- a/bin/gfx/gfx.h
+++ b/gfx/gfx.h
diff --git a/bin/gfxx.c b/gfx/gfxx.c
index 9e3c940e..4cb08a28 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 95f08949..95f08949 100644
--- a/bin/gfx/x11.c
+++ b/gfx/x11.c