Tweak was incorrectly handling the terminal default colour scheme.
[sgt/tweak] / Makefile
1 CC := gcc
2 CFLAGS := -g -c -Wall $(XFLAGS)
3 LINK := gcc
4 LFLAGS :=
5 LIBS :=
6
7 PREFIX=/usr/local
8 BINDIR=$(PREFIX)/bin
9 MANDIR=$(PREFIX)/man/man1
10
11 TWEAK := main.o keytab.o actions.o search.o rcfile.o buffer.o btree.o
12
13 ifeq ($(SLANG),yes)
14 # INCLUDE += -I/path/to/slang/include
15 # LIBS += -L/path/to/slang/lib
16 LIBS += -lslang
17 TWEAK += slang.o
18 else
19 LIBS += -lncurses
20 TWEAK += curses.o
21 endif
22
23 .c.o:
24 $(CC) $(CFLAGS) $*.c
25
26 all: tweak tweak.1 btree.html
27
28 tweak: $(TWEAK)
29 $(LINK) -o tweak $(TWEAK) $(LIBS)
30
31 tweak.1: manpage.but
32 halibut --man=$@ $<
33
34 btree.html: btree.but
35 halibut --html=$@ $<
36
37 # Ensure tweak.h reflects this version number, and then run a
38 # command like `make release VERSION=3.00'.
39 release: tweak.1 btree.html
40 mkdir -p reltmp/tweak-$(VERSION)
41 for i in LICENCE *.c *.h *.but tweak.1 btree.html Makefile; do \
42 ln -s ../../$$i reltmp/tweak-$(VERSION); \
43 done
44 (cd reltmp; tar chzvf ../tweak-$(VERSION).tar.gz tweak-$(VERSION))
45 rm -rf reltmp
46
47 install: tweak tweak.1
48 mkdir -p $(BINDIR)
49 install tweak $(BINDIR)/tweak
50 mkdir -p $(MANDIR)
51 install -m 0644 tweak.1 $(MANDIR)/tweak.1
52
53 clean:
54 rm -f *.o tweak tweak.1 btree.html
55
56 main.o: main.c tweak.h
57 keytab.o: keytab.c tweak.h
58 actions.o: actions.c tweak.h
59 search.o: search.c tweak.h
60 rcfile.o: rcfile.c tweak.h
61 buffer.o: buffer.c tweak.h btree.h
62 slang.o: slang.c tweak.h
63 curses.o: curses.c tweak.h
64 btree.o: btree.c btree.h