1# Additional tests to run before releasing a package.
2#
3# Run like:
4#   make PACKAGE=/path/to/protobuf-VERSION.tar.gz
5#
6# Some of these tests require tools or make assumptions that may not be
7# available on end-user machines, so these cannot be part of "make check".  For
8# example, we test that the headers compile with strict warning settings, but
9# since different compilers produce wildly different warnings we cannot assume
10# that this test will pass everywhere.  If we ran it as part of "make check",
11# it could unnecessarily block users from running the real tests just because
12# their compiler produces some extra warnings that probably aren't a big deal.
13# So we run it separately.
14
15all: header_warning_test
16
17clean:
18	rm -rf src target header_warning_test.cc header_warning_test.o header_warning_test
19
20# Unpack the package into src, then install it into target.
21PACKAGE=protobuf.tar.gz
22
23src: $(PACKAGE)
24	tar zxvf $(PACKAGE)
25	mv `basename $(PACKAGE) .tar.gz` src
26
27target: src
28	(cd src && ./configure --prefix=$$PWD/../target --disable-shared)
29	(cd src && make -j4 check)
30	(cd src && make install)
31
32# Verify that headers produce no warnings even under strict settings.
33header_warning_test.cc: target
34	( (cd target/include && find google/protobuf -name '*.h') | \
35	  awk '{print "#include \""$$1"\""} ' > header_warning_test.cc )
36
37header_warning_test: header_warning_test.cc
38	# TODO(kenton):  Consider adding -pedantic and -Weffc++.  Currently these
39	#   produce tons of extra warnings so we'll need to do some work first.
40	g++ -Itarget/include -Wall -Werror -Wsign-compare -O2 -c header_warning_test.cc
41	touch header_warning_test
42