Browse Source

Move graphical programs out of bin

I wonder when the last time was something needed -ledit...
June 4 months ago
parent
commit
41ca10496f
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
11 changed files with 41 additions and 42 deletions
  1. 0
    3
      bin/.gitignore
  2. 4
    13
      bin/Makefile
  3. 0
    24
      bin/gfx/none.c
  4. 4
    0
      gfx/.gitignore
  5. 31
    0
      gfx/Makefile
  6. 1
    1
      gfx/brot.c
  7. 0
    0
      gfx/cocoa.m
  8. 0
    0
      gfx/fb.c
  9. 0
    0
      gfx/gfx.h
  10. 1
    1
      gfx/gfxx.c
  11. 0
    0
      gfx/x11.c

+ 0
- 3
bin/.gitignore View File

@@ -1,9 +1,6 @@
1
-*.o
2 1
 tags
3 2
 atch
4
-brot
5 3
 dtch
6
-gfxx
7 4
 glitch
8 5
 hnel
9 6
 modem

+ 4
- 13
bin/Makefile View File

@@ -1,13 +1,10 @@
1
-ANY_BINS = atch brot dtch gfxx glitch hnel modem pbcopy pbd pbpaste pngo scheme wake xx
1
+ANY_BINS = atch dtch glitch hnel modem pbcopy pbd pbpaste pngo scheme wake xx
2 2
 BSD_BINS = klon watch
3 3
 LIN_BINS = bri fbatt fbclock
4 4
 ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(LIN_BINS)
5
-GFX ?= none
6 5
 
7 6
 CFLAGS += -Wall -Wextra -Wpedantic
8
-LDLIBS = -lcurses -ledit -lm -lutil -lz
9
-LDLIBS_cocoa = -framework Cocoa
10
-LDLIBS_x11 = -lX11
7
+LDLIBS = -lcurses -lm -lutil -lz
11 8
 
12 9
 any: .gitignore tags $(ANY_BINS)
13 10
 
@@ -16,7 +13,7 @@ bsd: any $(BSD_BINS)
16 13
 linux: any $(LIN_BINS)
17 14
 
18 15
 .gitignore: Makefile
19
-	echo '*.o' tags $(ALL_BINS) scheme.png | tr ' ' '\n' > .gitignore
16
+	echo tags $(ALL_BINS) scheme.png | tr ' ' '\n' > .gitignore
20 17
 
21 18
 tags: *.c
22 19
 	ctags -w *.c
@@ -24,12 +21,6 @@ tags: *.c
24 21
 atch: dtch
25 22
 	ln -f dtch atch
26 23
 
27
-brot: brot.o gfx/$(GFX).o
28
-	$(CC) $(LDFLAGS) brot.o gfx/$(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
29
-
30
-gfxx: gfxx.o gfx/$(GFX).o
31
-	$(CC) $(LDFLAGS) gfxx.o gfx/$(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
32
-
33 24
 pbcopy pbpaste: pbd
34 25
 	ln -f pbd $@
35 26
 
@@ -41,7 +32,7 @@ setuid: bri
41 32
 	chmod u+s bri
42 33
 
43 34
 clean:
44
-	rm -f tags *.o gfx/*.o $(ALL_BINS)
35
+	rm -f tags $(ALL_BINS)
45 36
 
46 37
 link:
47 38
 	mkdir -p ~/.local/bin

+ 0
- 24
bin/gfx/none.c View File

@@ -1,24 +0,0 @@
1
-/* Copyright (c) 2018, Curtis McEnroe <programble@gmail.com>
2
- *
3
- * This program is free software: you can redistribute it and/or modify
4
- * it under the terms of the GNU Affero General Public License as published by
5
- * the Free Software Foundation, either version 3 of the License, or
6
- * (at your option) any later version.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
- * GNU Affero General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU Affero General Public License
14
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
- */
16
-
17
-#include <err.h>
18
-#include <sysexits.h>
19
-
20
-#include "gfx.h"
21
-
22
-int main() {
23
-	errx(EX_CONFIG, "no gfx frontend");
24
-}

+ 4
- 0
gfx/.gitignore View File

@@ -0,0 +1,4 @@
1
+*.o
2
+tags
3
+brot
4
+gfxx

+ 31
- 0
gfx/Makefile View File

@@ -0,0 +1,31 @@
1
+BINS = brot gfxx
2
+GFX ?= cocoa
3
+
4
+CFLAGS += -Wall -Wextra -Wpedantic
5
+LDLIBS = -lm -lz
6
+LDLIBS_cocoa = -framework Cocoa
7
+LDLIBS_x11 = -lX11
8
+
9
+all: .gitignore tags $(BINS)
10
+
11
+.gitignore: Makefile
12
+	echo '*.o' tags $(BINS) | tr ' ' '\n' > .gitignore
13
+
14
+tags: *.h *.c
15
+	ctags -w *.h *.c
16
+
17
+brot: brot.o $(GFX).o
18
+	$(CC) $(LDFLAGS) brot.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
19
+
20
+gfxx: gfxx.o $(GFX).o
21
+	$(CC) $(LDFLAGS) gfxx.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
22
+
23
+clean:
24
+	rm -f tags *.o $(BINS)
25
+
26
+link:
27
+	mkdir -p ~/.local/bin
28
+	ln -s -f $(BINS:%=$(PWD)/%) ~/.local/bin
29
+
30
+unlink:
31
+	rm -f $(BINS:%=~/.local/bin/%)

bin/brot.c → gfx/brot.c View File

@@ -26,7 +26,7 @@
26 26
 #include <time.h>
27 27
 #include <unistd.h>
28 28
 
29
-#include "gfx/gfx.h"
29
+#include "gfx.h"
30 30
 
31 31
 #define RGB(r, g, b) ((uint32_t)(r) << 16 | (uint32_t)(g) << 8 | (uint32_t)(b))
32 32
 #define GRAY(n) RGB(n, n, n)

bin/gfx/cocoa.m → gfx/cocoa.m View File


bin/gfx/fb.c → gfx/fb.c View File


bin/gfx/gfx.h → gfx/gfx.h View File


bin/gfxx.c → gfx/gfxx.c View File

@@ -29,7 +29,7 @@
29 29
 #include <unistd.h>
30 30
 #include <zlib.h>
31 31
 
32
-#include "gfx/gfx.h"
32
+#include "gfx.h"
33 33
 
34 34
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
35 35
 #define MASK(b) ((1 << (b)) - 1)

bin/gfx/x11.c → gfx/x11.c View File


Loading…
Cancel
Save