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