cvs_direct -> cvsclient. All regression tests pass.
[cvsps:cvsps.git] / Makefile
1 VERSION=3.2
2
3 CC?=gcc
4 CFLAGS?=-g -O2 -Wall 
5 CPPFLAGS+=-I. -DVERSION=\"$(VERSION)\"
6 prefix?=/usr/local
7 OBJS=\
8         cbtcommon/debug.o\
9         cbtcommon/hash.o\
10         cbtcommon/text_util.o\
11         cbtcommon/sio.o\
12         cbtcommon/tcpsocket.o\
13         cvsps.o\
14         util.o\
15         stats.o\
16         cvsclient.o\
17         list_sort.o
18
19 all: cvsps 
20
21 deps:
22         makedepend -Y -I. *.c cbtcommon/*.c
23
24 cvsps: $(OBJS)
25         $(CC) -o cvsps $(OBJS) -lz
26
27 check:
28         @(cd test >/dev/null; make --quiet)
29
30 cppcheck:
31         cppcheck --template gcc --enable=all --suppress=unusedStructMember *.[ch]
32
33 # Requires asciidoc
34 cvsps.1: cvsps.asc
35         a2x --doctype manpage --format manpage cvsps.asc
36 cvsps.html: cvsps.asc
37         a2x --doctype manpage --format xhtml cvsps.asc
38
39 install: cvsps.1
40         [ -d $(prefix)/bin ] || mkdir -p $(prefix)/bin
41         [ -d $(prefix)/share/man/man1 ] || mkdir -p $(prefix)/share/man/man1
42         install cvsps $(prefix)/bin
43         install -m 644 cvsps.1 $(prefix)/share/man/man1
44
45 tags: *.c *.h cbtcommon/*.c cbtcommon/*.h
46         ctags *.c *.h cbtcommon/*.c cbtcommon/*.h
47
48 clean:
49         rm -f cvsps *.o cbtcommon/*.o core tags cvsps.spec cvsps.1 cvsps.html
50
51 cvsps.spec: cvsps.spec.dist
52         echo "Version: $(VERSION)" >cvsps.spec
53
54 SOURCES = Makefile *.[ch] cbtcommon/*.[ch] merge_utils.sh
55 DOCS = README COPYING NEWS cvsps.asc TODO
56 ALL =  $(SOURCES) $(DOCS) control
57 cvsps-$(VERSION).tar.gz: $(ALL)
58         tar --transform='s:^:cvsps-$(VERSION)/:' --show-transformed-names -cvzf cvsps-$(VERSION).tar.gz $(ALL)
59
60 dist: cvsps-$(VERSION).tar.gz
61
62 release: cvsps-$(VERSION).tar.gz cvsps.html
63         shipper -u -m -t; make clean
64
65 .PHONY: install clean version dist check
66 # DO NOT DELETE
67
68 cvsclient.o: ./cbtcommon/debug.h ./cbtcommon/inline.h
69 cvsclient.o: ./cbtcommon/text_util.h ./cbtcommon/tcpsocket.h
70 cvsclient.o: ./cbtcommon/sio.h cvsclient.h util.h
71 cvsps.o: ./cbtcommon/hash.h ./cbtcommon/list.h ./cbtcommon/inline.h
72 cvsps.o: ./cbtcommon/list.h ./cbtcommon/text_util.h ./cbtcommon/debug.h
73 cvsps.o: cvsps_types.h cvsps.h util.h stats.h cvsclient.h list_sort.h
74 list_sort.o: list_sort.h ./cbtcommon/list.h
75 stats.o: ./cbtcommon/hash.h ./cbtcommon/list.h ./cbtcommon/inline.h
76 stats.o: cvsps_types.h cvsps.h
77 util.o: ./cbtcommon/debug.h ./cbtcommon/inline.h util.h
78 cbtcommon/debug.o: cbtcommon/debug.h ./cbtcommon/inline.h
79 cbtcommon/hash.o: cbtcommon/debug.h ./cbtcommon/inline.h cbtcommon/hash.h
80 cbtcommon/hash.o: ./cbtcommon/list.h
81 cbtcommon/sio.o: cbtcommon/sio.h
82 cbtcommon/tcpsocket.o: cbtcommon/tcpsocket.h cbtcommon/debug.h
83 cbtcommon/tcpsocket.o: ./cbtcommon/inline.h
84 cbtcommon/text_util.o: cbtcommon/text_util.h