summary refs log tree commit diff
path: root/gfx/Makefile
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 /gfx/Makefile
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 'gfx/Makefile')
-rw-r--r--gfx/Makefile31
1 files changed, 31 insertions, 0 deletions
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/%)