-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
89 lines (66 loc) · 2.04 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
CC = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
headers = $(wildcard src/*.h) config.h
sources = $(wildcard src/*.c)
objects = $(subst .c,.o,$(sources))
vcprompt: $(objects) Makefile
$(CC) $(LDFLAGS) -o $@ $(objects) $(LIBS)
Makefile: Makefile.in configure
./configure -C
config.h: config.h.in
rm -f $@
./configure -C
configure: configure.ac
autoconf
# build a standalone version of capture_child() library for testing
src/capture: src/capture.c src/capture.h src/common.c src/common.h
$(CC) -DTEST_CAPTURE $(CFLAGS) -o $@ src/capture.c src/common.c
# Maximally pessimistic view of header dependencies.
$(objects): $(headers) Makefile
.PHONY: check check-simple check-hg check-git check-svn check-fossil grind
check: check-simple check-hg check-git check-svn check-fossil
hgrepo = tests/hg-repo.tar
gitrepo = tests/git-repo.tar
svnrepos = tests/svn-repo-1.tar tests/svn-repo-2.tar
fossilrepo = tests/fossil-repo
check-simple: vcprompt
cd tests && ./test-simple
check-hg: vcprompt $(hgrepo)
cd tests && ./test-hg
$(hgrepo): tests/setup-hg
cd tests && ./setup-hg
check-git: vcprompt $(gitrepo)
cd tests && ./test-git
$(gitrepo): tests/setup-git
cd tests && ./setup-git
check-svn: vcprompt $(svnrepos)
cd tests && ./test-svn
$(svnrepos): tests/setup-svn
cd tests && ./setup-svn
check-fossil: vcprompt $(fossilrepo)
cd tests && ./test-fossil
$(fossilrepo): tests/setup-fossil
cd tests && ./setup-fossil
grind:
make check VCPVALGRIND=y
clean:
rm -f $(objects) vcprompt $(hgrepo) $(gitrepo) $(fossilrepo)
DESTDIR =
PREFIX = /usr/local
BINDIR = $(DESTDIR)$(PREFIX)/bin
MANDIR = $(DESTDIR)$(PREFIX)/man/man1
.PHONY: install
install: vcprompt
install -d $(BINDIR) $(MANDIR)
install vcprompt $(BINDIR)
install vcprompt.1 $(MANDIR)
.PHONY: dist
dist: configure
[ "$$ver" ] || (echo "\$$ver not set" >&2; exit 1)
hg archive -r $$ver -t files -X ".hg*" dist/vcprompt-$$ver
(cd dist/vcprompt-$$ver && autoconf && rm -rf autom4te.cache)
(cd dist && tar -czf vcprompt-$$ver.tar.gz vcprompt-$$ver)
rm -rf dist/vcprompt-$$ver