diff options
author | June McEnroe <programble@gmail.com> | 2018-02-09 15:14:33 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-09 15:14:33 -0500 |
commit | 3d6cfca2326fe21c90668e02794a81d2ed7615de (patch) | |
tree | c1055d70ed6d310a46e945b8270cf909314d9ace | |
parent | Add janky X11 graphics frontend (diff) | |
download | src-3d6cfca2326fe21c90668e02794a81d2ed7615de.tar.gz src-3d6cfca2326fe21c90668e02794a81d2ed7615de.zip |
Move gfx frontends around to simplify build
I forgot that you can expand variables inside variables names in make. Certainly makes some fun things possible.
-rw-r--r-- | bin/.gitignore | 6 | ||||
-rw-r--r-- | bin/Makefile | 31 | ||||
-rw-r--r-- | bin/gfx/cocoa.m (renamed from bin/gfcocoa.m) | 0 | ||||
-rw-r--r-- | bin/gfx/fb.c (renamed from bin/gfb.c) | 0 | ||||
-rw-r--r-- | bin/gfx/none.c | 21 | ||||
-rw-r--r-- | bin/gfx/x11.c (renamed from bin/gfx11.c) | 0 |
6 files changed, 32 insertions, 26 deletions
diff --git a/bin/.gitignore b/bin/.gitignore index c7a9c768..bdc4ce80 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -2,6 +2,7 @@ tags *.o atch dtch +gfxx hnel pbcopy pbd @@ -12,11 +13,6 @@ jrp klon typo watch -gfxx-cocoa -gfxx bri fbatt fbclock -gfxx-fb -gfxx -gfxx-x11 diff --git a/bin/Makefile b/bin/Makefile index 5801ec74..2a4658f1 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -1,36 +1,25 @@ -ANY_BINS = atch dtch hnel pbcopy pbd pbpaste wake xx +ANY_BINS = atch dtch gfxx hnel pbcopy pbd pbpaste wake xx BSD_BINS = jrp klon typo watch -MAC_BINS = gfxx-cocoa gfxx -LIN_BINS = bri fbatt fbclock gfxx-fb gfxx -ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(MAC_BINS) $(LIN_BINS) gfxx-x11 +LIN_BINS = bri fbatt fbclock +ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(LIN_BINS) +GFX = none CFLAGS += -Wall -Wextra -Wpedantic LDLIBS = -lcurses -ledit -lutil -lz +LDLIBS_cocoa = $(LDLIBS) -framework Cocoa +LDLIBS_x11 = $(LDLIBS) -lX11 any: .gitignore tags $(ANY_BINS) bsd: any $(BSD_BINS) -mac: bsd $(MAC_BINS) - linux: any $(LIN_BINS) atch: dtch ln -f dtch atch -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-x11: gfxx.o gfx11.o - $(CC) $(LDFLAGS) gfxx.o gfx11.o $(LDLIBS) -lX11 -o $@ - -gfxx: - [ -f gfxx-fb ] && ln -s -f gfxx-fb gfxx || true - [ -f gfxx-x11 ] && ln -s -f gfxx-x11 gfxx || true - [ -f gfxx-cocoa ] && ln -s -f gfxx-cocoa gfxx || true +gfxx: gfxx.o gfx/$(GFX).o + $(CC) $(LDFLAGS) gfxx.o gfx/$(GFX).o $(LDLIBS_$(GFX)) -o $@ pbcopy pbpaste: pbd ln -f pbd $@ @@ -40,7 +29,7 @@ setuid: bri chmod u+s bri clean: - rm -f *.o $(ALL_BINS) + rm -f *.o gfx/*.o $(ALL_BINS) link: ln -s -f $(ALL_BINS:%=$(PWD)/%) ~/.bin @@ -54,4 +43,4 @@ unlink: tags: *.c ctags *.c -.PHONY: any bsd mac linux setuid clean link unlink +.PHONY: any bsd linux setuid clean link unlink diff --git a/bin/gfcocoa.m b/bin/gfx/cocoa.m index ece79fb5..ece79fb5 100644 --- a/bin/gfcocoa.m +++ b/bin/gfx/cocoa.m diff --git a/bin/gfb.c b/bin/gfx/fb.c index 503a8781..503a8781 100644 --- a/bin/gfb.c +++ b/bin/gfx/fb.c diff --git a/bin/gfx/none.c b/bin/gfx/none.c new file mode 100644 index 00000000..b1558da5 --- /dev/null +++ b/bin/gfx/none.c @@ -0,0 +1,21 @@ +/* Copyright (c) 2018, Curtis 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 <sysexits.h> + +int main() { + return EX_CONFIG; +} diff --git a/bin/gfx11.c b/bin/gfx/x11.c index b1b8caca..b1b8caca 100644 --- a/bin/gfx11.c +++ b/bin/gfx/x11.c |