summary refs log tree commit diff
path: root/gfx/Makefile
blob: 20ff5ecd0b68ed2faef2b2ac66f526bfc9d39044 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
GFX ?= cocoa
PREFIX = ~/.local

BINS = brot gfxx
MAN1 = $(BINS:%=man/%.1)

CFLAGS += -Wall -Wextra -Wpedantic
LDLIBS = -lm
LDLIBS_cocoa = -framework Cocoa
LDLIBS_x11 = -lX11

all: .gitignore tags $(BINS)

tags: *.h *.c
	ctags -w *.h *.c

brot.o gfxx.o: gfx.h

cocoa.o fb.o x11.o: gfx.h

gfxx.o: png.h

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)

README: man/gfx.7
	mandoc man/gfx.7 | col -b -x > README

.gitignore: Makefile
	echo '*.o' tags $(BINS) | tr ' ' '\n' > .gitignore

link:
	mkdir -p $(PREFIX)/bin $(PREFIX)/share/man/man1
	ln -s -f $(BINS:%=$(PWD)/%) $(PREFIX)/bin
	ln -s -f $(MAN1:%=$(PWD)/%) $(PREFIX)/share/man/man1

unlink:
	rm -f $(BINS:%=$(PREFIX)/bin/%)
	rm -f $(MAN1:%=$(PREFIX)/share/man/man1/%)
lean up style in xxJune McEnroe 2017-05-01Clean up style in pbdJune McEnroe 2017-05-01Use EX_OK in pbcopyJune McEnroe 2017-04-30Clean up clockJune McEnroe 2017-04-30Clean up error strings in briJune McEnroe 2017-03-18Add -u option to xxJune McEnroe 2017-03-15Fix non-string-literal-format-string in briJune McEnroe 2017-03-15Fix bri compilationJune McEnroe cc will remove the file itself just fine. Always exit in case any of the shell commands fail. 2017-03-15Use psvar for title settingJune McEnroe Prevents prompt expansion from happening on the command being run when it is set in the title. 2017-03-14Add bri brightness control scriptJune McEnroe This is probably terrible. 2017-03-14Add comment to tmux terminal overrideJune McEnroe 2017-03-13Have tmux set block cursor on linux consoleJune McEnroe 2017-03-13Use inverse for Visual in colorschemeJune McEnroe