Browser: add 'c' command to accept a conflict.
[wiggle/upstream.git] / Makefile
blob850d68116970b492b1015081d35cbc539a5f5168
2 # Note on my Mobile Pentium II, -march=pentium2 delivers twice the performance of i386
3 #OptDbg=-O3
4 #OptDbg=-O3 -march=pentium2
5 OptDbg=-ggdb
6 CFLAGS=$(OptDbg) -I. -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
8 # STRIP = -s
9 INSTALL = /usr/bin/install
10 DESTDIR =
11 BINDIR = /usr/bin
12 MANDIR = /usr/share/man
13 MAN1DIR = $(MANDIR)/man1
14 MAN5DIR = $(MANDIR)/man5
15 LDLIBS = -lncurses
17 all: wiggle wiggle.man test
19 wiggle : wiggle.o load.o parse.o split.o extract.o diff.o bestmatch.o ReadMe.o \
20 merge2.o vpatch.o ccan/hash/hash.o
21 wiggle.o load.o parse.o split.o extract.o diff.o bestmatch.o \
22 merge2.o vpatch.o :: wiggle.h
23 split.o :: ccan/hash/hash.h config.h
25 VERSION = $(shell [ -d .git ] && git describe HEAD)
26 VERS_DATE = $(shell [ -d .git ] && git log -n1 --format=format:%cd --date=short)
27 DVERS = $(if $(VERSION),-DVERSION=\"$(VERSION)\",)
28 DDATE = $(if $(VERS_DATE),-DVERS_DATE=\"$(VERS_DATE)\",)
29 CFLAGS += $(DVERS) $(DDATE)
31 test: wiggle dotest
32 ./dotest
34 valgrind: wiggle dotest
35 ./dotest valgrind
37 vtest: wiggle dovtest
38 ./dovtest
40 wiggle.man : wiggle.1
41 nroff -man wiggle.1 > wiggle.man
43 clean:
44 rm -f *.o ccan/hash/*.o *.man wiggle .version* demo.patch version
45 find . -name core -o -name '*.tmp*' -o -name .tmp -o -name .time | xargs rm -f
47 install : wiggle wiggle.1
48 $(INSTALL) -D $(STRIP) -m 755 wiggle $(DESTDIR)$(BINDIR)/wiggle
49 $(INSTALL) -D -m 644 wiggle.1 $(DESTDIR)$(MAN1DIR)/wiggle.1
51 version : ReadMe.c wiggle.1
52 @rm -f version
53 @sed -n -e 's/.*VERSION "\([0-9.]*\)".*/\1/p' ReadMe.c > .version-readme
54 @sed -n -e 's/.*WIGGLE 1 "" v\([0-9.]*\)$$/\1/p' wiggle.1 > .version-man
55 @cmp -s .version-readme .version-man && cat .version-man > version || { echo Inconsistant versions.; exit 1;}
57 dist : test clean version
58 mkdir -p DIST
59 rm -f DIST/wiggle-`cat version`
60 git archive --prefix wiggle-`cat version`/ v`cat version` | gzip -9 > DIST/wiggle-`cat version`.tar.gz
62 v : version
63 cat version
65 demo.patch: force
66 diff -ru demo.orig demo.patched | sed 's/demo.patched/demo/' > demo.patch
68 force: