summary refs log tree commit diff
path: root/bin/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-04 19:13:05 -0500
committerJune McEnroe <programble@gmail.com>2018-02-04 19:13:05 -0500
commitedbbd92ce0b56141a230eb4bad05cd5e56685112 (patch)
treead6d5bd7c3a2bcb8dc991403a325d11b99c05ce3 /bin/Makefile
parentAvoid doing excessive work in gfxx (diff)
downloadsrc-edbbd92ce0b56141a230eb4bad05cd5e56685112.tar.gz
src-edbbd92ce0b56141a230eb4bad05cd5e56685112.zip
Set up Makefile for gfxx-cocoa or gfxx-fb
Diffstat (limited to '')
-rw-r--r--bin/Makefile25
1 files changed, 18 insertions, 7 deletions
diff --git a/bin/Makefile b/bin/Makefile
index c7e44d87..78e422bc 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,21 +1,32 @@
 ANY_BINS = atch dtch hnel pbcopy pbd pbpaste wake xx
 BSD_BINS = jrp klon typo watch
-LIN_BINS = bri fbatt fbclock gfxx
-ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(LIN_BINS)
+MAC_BINS = gfxx-cocoa gfxx
+LIN_BINS = bri fbatt fbclock gfxx-fb gfxx
+ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(MAC_BINS) $(LIN_BINS)
 
 CFLAGS += -Wall -Wextra -Wpedantic
 LDLIBS = -lcurses -ledit -lutil -lz
 
-any: $(ANY_BINS) .gitignore
+any: .gitignore $(ANY_BINS)
 
-bsd: $(ANY_BINS) $(BSD_BINS) .gitignore
+bsd: any $(BSD_BINS)
 
-linux: $(ANY_BINS) $(LIN_BINS) .gitignore
+mac: bsd $(MAC_BINS)
+
+linux: any $(LIN_BINS)
 
 atch: dtch
 	ln -f dtch atch
 
-gfxx: gfxx.o gfb.o
+gfxx-cocoa: gfxx.o gfcocoa.o
+	$(CC) $(LDFLAGS) gfxx.o gfcocoa.o $(LDLIBS) -framework Cocoa -o $@
+
+gfxx-fb: gfxx.o gfb.o
+	$(CC) $(LDFLAGS) gfxx.o gfb.o $(LDLIBS) -o $@
+
+gfxx:
+	[ -f gfxx-cocoa ] && ln -s gfxx-cocoa gfxx || true
+	[ -f gfxx-fb ] && ln -s gfxx-fb gfxx || true
 
 pbcopy pbpaste: pbd
 	ln -f pbd $@
@@ -25,7 +36,7 @@ setuid: bri
 	chmod u+s bri
 
 clean:
-	rm -f $(ALL_BINS)
+	rm -f *.o $(ALL_BINS)
 
 link:
 	ln -s -f $(ALL_BINS:%=$(PWD)/%) ~/.bin