2014-03-16 11:38:19 +04:00
LIBSUBDIRS = src src-cpp
2012-09-19 14:26:37 +04:00
2014-03-16 11:38:19 +04:00
CHECK_FILES += CONFIGURATION.md \
examples/rdkafka_example examples/rdkafka_performance \
examples/rdkafka_example_cpp
2012-09-19 14:26:37 +04:00
2020-03-31 09:00:16 +03:00
DOC_FILES += LICENSE LICENSES.txt INTRODUCTION.md README.md \
CONFIGURATION.md STATISTICS.md
2019-07-03 14:39:58 +03:00
PKGNAME ?= librdkafka
2020-04-29 10:19:32 +03:00
VERSION ?= $( shell python3 packaging/get_version.py src/rdkafka.h)
2015-12-02 21:28:53 +03:00
2015-04-09 18:30:09 +03:00
# Jenkins CI integration
BUILD_NUMBER ?= 1
2019-05-27 16:27:22 +03:00
# Skip copyright check in the following paths
MKL_COPYRIGHT_SKIP ?= ^( tests| packaging)
2012-09-19 14:26:37 +04:00
.PHONY :
2014-03-16 11:38:19 +04:00
all : mklove -check libs CONFIGURATION .md check
2012-09-19 14:26:37 +04:00
2014-03-16 11:38:19 +04:00
i n c l u d e m k l o v e / M a k e f i l e . b a s e
2012-09-19 14:26:37 +04:00
2014-03-16 11:38:19 +04:00
libs :
@( for d in $( LIBSUBDIRS) ; do $( MAKE) -C $$ d || exit $? ; done )
2012-09-19 14:26:37 +04:00
2014-03-16 11:38:19 +04:00
CONFIGURATION.md : src /rdkafka .h examples
2019-07-03 14:39:58 +03:00
@printf " $( MKL_YELLOW) Updating $@ $( MKL_CLR_RESET) \n "
2019-03-14 19:35:07 +03:00
@echo "# Configuration properties" > CONFIGURATION.md.tmp
2019-08-15 12:25:27 +03:00
@( examples/rdkafka_performance -X list | \
sed 's/||/\\|\\|/g' >> \
CONFIGURATION.md.tmp; \
2015-04-21 20:12:45 +03:00
cmp CONFIGURATION.md CONFIGURATION.md.tmp || \
2014-02-05 10:11:05 +04:00
mv CONFIGURATION.md.tmp CONFIGURATION.md; \
2015-04-21 20:12:45 +03:00
rm -f CONFIGURATION.md.tmp)
2013-10-04 02:15:59 +04:00
2017-04-11 14:59:08 +03:00
file-check : CONFIGURATION .md LICENSES .txt examples
2014-03-16 11:38:19 +04:00
check : file -check
@( for d in $( LIBSUBDIRS) ; do $( MAKE) -C $$ d $@ || exit $? ; done )
2013-09-23 18:31:56 +04:00
2019-07-03 14:39:58 +03:00
install-subdirs :
@( for d in $( LIBSUBDIRS) ; do $( MAKE) -C $$ d install || exit $? ; done )
install : install -subdirs doc -install
uninstall-subdirs :
@( for d in $( LIBSUBDIRS) ; do $( MAKE) -C $$ d uninstall || exit $? ; done )
uninstall : uninstall -subdirs doc -uninstall
2014-02-05 10:11:05 +04:00
2015-01-29 02:05:33 +03:00
examples tests : .PHONY libs
2014-03-16 11:38:19 +04:00
$( MAKE) -C $@
2014-02-05 10:11:05 +04:00
2015-12-07 05:13:32 +03:00
docs :
doxygen Doxyfile
@echo "Documentation generated in staging-docs"
2015-12-08 03:45:09 +03:00
clean-docs :
rm -rf staging-docs
2012-09-19 14:26:37 +04:00
clean :
2014-03-16 11:38:19 +04:00
@$( MAKE) -C tests $@
@$( MAKE) -C examples $@
@( for d in $( LIBSUBDIRS) ; do $( MAKE) -C $$ d $@ ; done )
2015-04-09 18:30:09 +03:00
2019-02-13 11:06:57 +03:00
distclean : clean deps -clean
2015-12-02 21:28:53 +03:00
./configure --clean
rm -f config.log config.log.old
archive :
2019-07-03 14:39:58 +03:00
git archive --prefix= $( PKGNAME) -$( VERSION) / \
-o $( PKGNAME) -$( VERSION) .tar.gz HEAD
git archive --prefix= $( PKGNAME) -$( VERSION) / \
-o $( PKGNAME) -$( VERSION) .zip HEAD
2015-12-02 21:28:53 +03:00
2016-01-13 14:52:34 +03:00
rpm : distclean
$( MAKE) -C packaging/rpm
2016-11-21 23:51:25 +03:00
2017-04-11 14:59:08 +03:00
LICENSES.txt : .PHONY
2017-05-11 11:56:09 +03:00
@( for i in LICENSE LICENSE.*[ ^~] ; do ( echo " $$ i " ; echo "--------------------------------------------------------------" ; cat $$ i ; echo "" ; echo "" ) ; done ) > $@ .tmp
2017-04-11 14:59:08 +03:00
@cmp $@ $@ .tmp || mv $@ .tmp $@ ; rm -f $@ .tmp
2016-11-21 23:51:25 +03:00
2019-08-21 13:43:11 +03:00
coverity : Makefile .config
@( which cov-build >/dev/null 2>& 1 || echo "Make sure coverity../bin is in your PATH" )
@( cd src && \
make clean && \
( rm -rf cov-int cov-librdkafka.tgz cov-build || true ) && \
cov-build --dir cov-int make -j && \
tar cvzf ../cov-librdkafka.tgz cov-int && \
printf " $( MKL_GREEN) Now upload cov-librdkafka.tgz to Coverity for analysis $( MKL_CLR_RESET) \n " )