OSDN Git Service

Merge branch 'duplicated-logcheck' into buildenv
[ultramonkey-l7/ultramonkey-l7-v2.git] / Makefile.am
1 ######################################################################
2 # Makefile                                                 August 2005
3 #
4 # L7VSD: Linux Virtual Server for Layer7 Load Balancing
5 # Copyright (C) 2005  NTT COMWARE Corporation.
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 # 02110-1301 USA
21 #
22 ######################################################################
23
24 SUBDIRS = \
25         snmpagent \
26         logger \
27         parameter \
28         src \
29         module \
30         conf \
31         init.d \
32         l7directord \
33         man \
34         doc
35
36 docdir = ${datadir}/doc/${PACKAGE}-${VERSION}
37 dist_doc_DATA = \
38         README
39
40 EXTRA_DIST = \
41         CHANGES \
42         INSTALL.debian \
43         INSTALL.ja.utf-8 \
44         VERSION \
45         genvers.sh \
46         ultramonkey-l7.spec \
47         ultramonkey-l7.spec.in
48
49 l7vsadm_sockdir = @l7vsadm_sockdir@
50 l7vs_logdir = @l7vs_logdir@
51
52 ultramonkey-l7.spec: ultramonkey-l7.spec.in VERSION
53         ( \
54                 uml7version=`echo $(PACKAGE_VERSION) | sed -e 's/-.*//;'` ;\
55                 uml7patchlv=`echo $(PACKAGE_VERSION) | sed -e 's/^[^-]*//; s/-//;'` ;\
56                 cat $< |sed -e "s/@uml7version@/$$uml7version/g; s/@uml7patchlv@/$$uml7patchlv/g;" > $@ ; )
57
58 VERSION:
59         (cd $(top_srcdir) ;\
60                 echo `./genvers.sh` $< > $@.new ;\
61                 mv -f $@.new $@ ;)
62
63 release:
64         (rm -f $(top_srcdir)/VERSION ;\
65                 autoreconf -ifv $(top_srcdir) ;\
66                 $(MAKE) distcheck ;)
67
68 rpm: $(DIST_ARCHIVES)
69         rpmbuild -ta $(DIST_ARCHIVES)
70
71 install-data-hook:
72         mkdir -p $(DESTDIR)$(l7vsadm_sockdir)
73         mkdir -p $(DESTDIR)$(l7vs_logdir)
74
75 extract_log.check:
76         find $(distdir) -type f \( -name '*.c' -o -name '*.cpp' \) -print0 \
77                 | xargs -0 perl $(distdir)/logger/extract_log \
78                 > extract_log.out 2>/dev/null
79         @(dupcount=`grep -c '^LOG_CAT_[0-9A-Z_]* (duplicate)' extract_log.out` || true ; \
80         if test x0 != x$$dupcount ;\
81         then \
82                 echo "ERROR: Duplicated log ID found!  " ;\
83                 echo -n "ERROR: Check marked line as 'DUPLICATE' in " ;\
84                 echo "extract_log.out" ;\
85                 echo "=====================================================";\
86                 grep 'DUPLICATE' extract_log.out ;\
87                 echo "=====================================================";\
88                 exit 1 ;\
89         else \
90                 rm -f extract_log.out ;\
91         fi)
92
93 distcheck-hook: extract_log.check