Increase the size of the 'message' buffer, which is currently
[sgt/tweak] / Makefile
CommitLineData
11825bd4 1# Useful options you might want to put on the make command line:
2#
3# - `SLANG=yes' to build against libslang instead of libncurses
4# (libncurses is better and more reliable, but libslang might be
5# all you have on a particular platform if you're unlucky).
6#
7# - `XFLAGS=-DNO_LARGE_FILES' to leave out the 64-bit file access
8# support (restricts Tweak to editing files under 2Gb, but
9# should cause it to compile successfully on platforms without
10# fseeko and ftello and/or long long support).
11#
12# - `VERSION=X.XX' (for whatever X.XX you like) to cause the `make
13# release' target to build a release tarball called
14# `tweak-X.XX.tar.gz' which unpacks into a directory
15# `tweak-X.XX'. Note that you also need to modify the version
16# number in tweak.h, or else the resulting binary won't match
17# the version number on the archive.
18
6e182d98 19CC := gcc
20CFLAGS := -g -c -Wall $(XFLAGS)
21LINK := gcc
22LFLAGS :=
23LIBS :=
24
2a700721 25PREFIX=/usr/local
26BINDIR=$(PREFIX)/bin
27MANDIR=$(PREFIX)/man/man1
28
6e182d98 29TWEAK := main.o keytab.o actions.o search.o rcfile.o buffer.o btree.o
30
31ifeq ($(SLANG),yes)
32# INCLUDE += -I/path/to/slang/include
33# LIBS += -L/path/to/slang/lib
34LIBS += -lslang
35TWEAK += slang.o
36else
37LIBS += -lncurses
38TWEAK += curses.o
39endif
40
41.c.o:
42 $(CC) $(CFLAGS) $*.c
43
d28a4799 44all: tweak tweak.1 btree.html
6e182d98 45
46tweak: $(TWEAK)
47 $(LINK) -o tweak $(TWEAK) $(LIBS)
48
49tweak.1: manpage.but
50 halibut --man=$@ $<
51
d28a4799 52btree.html: btree.but
53 halibut --html=$@ $<
54
55# Ensure tweak.h reflects this version number, and then run a
56# command like `make release VERSION=3.00'.
57release: tweak.1 btree.html
58 mkdir -p reltmp/tweak-$(VERSION)
7cf0466a 59 for i in LICENCE *.c *.h *.but tweak.1 btree.html Makefile; do \
d28a4799 60 ln -s ../../$$i reltmp/tweak-$(VERSION); \
61 done
62 (cd reltmp; tar chzvf ../tweak-$(VERSION).tar.gz tweak-$(VERSION))
63 rm -rf reltmp
64
2a700721 65install: tweak tweak.1
66 mkdir -p $(BINDIR)
67 install tweak $(BINDIR)/tweak
68 mkdir -p $(MANDIR)
69 install -m 0644 tweak.1 $(MANDIR)/tweak.1
70
6e182d98 71clean:
d28a4799 72 rm -f *.o tweak tweak.1 btree.html
6e182d98 73
74main.o: main.c tweak.h
75keytab.o: keytab.c tweak.h
76actions.o: actions.c tweak.h
77search.o: search.c tweak.h
78rcfile.o: rcfile.c tweak.h
79buffer.o: buffer.c tweak.h btree.h
80slang.o: slang.c tweak.h
81curses.o: curses.c tweak.h
82btree.o: btree.c btree.h