Tizen 2.1 base
[external/popt.git] / Makefile.am
1 # Makefile for popt library.
2
3 AUTOMAKE_OPTIONS = 1.4 foreign
4
5 LINT =          splint
6 MCCABE =        pmccabe
7
8 EXTRA_DIST = config.rpath lookup3.c autogen.sh CHANGES $(man_MANS) \
9         m4/Makefile.in \
10         footer_no_timestamp.html libpopt.vers \
11         testit.sh test-poptrc \
12         popt.xcodeproj/project.pbxproj \
13         popt.ps
14
15 SUBDIRS = po . auto
16
17 AM_CPPFLAGS = -I. -I$(top_srcdir)
18
19 noinst_HEADERS = poptint.h system.h
20
21 noinst_PROGRAMS = test1 test2 tdict # test3
22 test1_SOURCES = test1.c
23 test1_LDFLAGS = 
24 test1_LDADD = $(usrlib_LTLIBRARIES)
25 test2_SOURCES = test2.c
26 test2_LDFLAGS = 
27 test2_LDADD = $(usrlib_LTLIBRARIES)
28 #test3_SOURCES = test3.c
29 #test3_LDFLAGS = 
30 #test3_LDADD = $(usrlib_LTLIBRARIES)
31 tdict_SOURCES = tdict.c
32 tdict_LDFLAGS = 
33 tdict_LDADD = $(usrlib_LTLIBRARIES)
34
35 noinst_SCRIPTS = testit.sh
36
37 TESTS_ENVIRONMENT = \
38 test1="$(top_builddir)/test1"
39
40 TESTS = $(top_srcdir)/testit.sh
41
42 include_HEADERS = popt.h
43
44 usrlibdir = $(libdir)
45 usrlib_LTLIBRARIES = libpopt.la
46
47 libpopt_la_SOURCES = popt.c poptparse.c poptconfig.c popthelp.c poptint.c
48 libpopt_la_LDFLAGS = -no-undefined @LTLIBINTL@ @LTLIBICONV@
49
50 pkgconfigdir = $(prefix)/lib/pkgconfig
51 pkgconfig_DATA = popt.pc
52
53 if HAVE_LD_VERSION_SCRIPT
54 libpopt_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/libpopt.vers
55 endif
56
57 man_MANS = popt.3
58
59 BUILT_SOURCES = popt.pc # popt.lcd
60
61 distclean-local:
62         rm -rf .ccache
63
64 .PHONY: updatepo
65 updatepo:
66         rsync -Lrtvz  translationproject.org::tp/latest/popt/  po
67
68 popt.lcd: Makefile.am ${libpopt_la_SOURCES} ${include_HEADERS} ${noinst_HEADERS}
69         lclint -dump $@ ${libpopt_la_SOURCES}
70
71 .PHONY: sources
72 sources:
73         @echo $(libpopt_la_SOURCES:%=popt/%)
74
75 .PHONY: lint
76 lint:
77         $(LINT) ${DEFS} ${INCLUDES} test1.c ${libpopt_la_SOURCES}
78
79 .PHONY: mccabe
80 mccabe:
81         $(MCCABE) $(libpopt_la_SOURCES) | sort -n -r | head -n 10
82
83 .PHONY: doxygen
84 doxygen: Doxyfile
85         rm -rf doxygen
86         mkdir -p doxygen
87         doxygen
88
89 .PHONY: lcov-reset      # run lcov from scratch, always
90 lcov-reset:
91         make lcov-run
92         make lcov-report
93
94 .PHONY: lcov            # run lcov from scratch if the dir is not there
95 lcov:
96         make lcov-reset
97
98 .PHONY: lcov-run        # reset run coverage tests
99 lcov-run:
100         @-rm -rf lcov
101         find . -name "*.gcda" -exec rm {} \;
102         make check
103
104 .PHONY: lcov-report     # generate report based on current coverage data
105 lcov-report:
106         mkdir lcov
107         lcov --directory . --capture --output-file lcov/lcov.info
108         lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove
109         lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info
110         rm lcov/remove
111         mv lcov/lcov.cleaned.info lcov/lcov.info
112         genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info
113
114 #.PHONY:        lcov-upload
115 #lcov-upload: lcov
116 #       rsync -rvz -e ssh --delete lcov/* ???
117
118 ACLOCAL_AMFLAGS = -I m4