6e182d98 |
1 | CC := gcc |
2 | CFLAGS := -g -c -Wall $(XFLAGS) |
3 | LINK := gcc |
4 | LFLAGS := |
5 | LIBS := |
6 | |
2a700721 |
7 | PREFIX=/usr/local |
8 | BINDIR=$(PREFIX)/bin |
9 | MANDIR=$(PREFIX)/man/man1 |
10 | |
6e182d98 |
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 | |
d28a4799 |
26 | all: tweak tweak.1 btree.html |
6e182d98 |
27 | |
28 | tweak: $(TWEAK) |
29 | $(LINK) -o tweak $(TWEAK) $(LIBS) |
30 | |
31 | tweak.1: manpage.but |
32 | halibut --man=$@ $< |
33 | |
d28a4799 |
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) |
7cf0466a |
41 | for i in LICENCE *.c *.h *.but tweak.1 btree.html Makefile; do \ |
d28a4799 |
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 | |
2a700721 |
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 | |
6e182d98 |
53 | clean: |
d28a4799 |
54 | rm -f *.o tweak tweak.1 btree.html |
6e182d98 |
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 |