Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. all: header_warning_test
  15. clean:
  16. rm -rf src target header_warning_test.cc header_warning_test.o header_warning_test
  17. # Unpack the package into src, then install it into target.
  18. PACKAGE=protobuf.tar.gz
  19. src: $(PACKAGE)
  20. tar zxvf $(PACKAGE)
  21. mv `basename $(PACKAGE) .tar.gz` src
  22. target: src
  23. (cd src && ./configure --prefix=$$PWD/../target --disable-shared)
  24. (cd src && make -j4 check)
  25. (cd src && make install)
  26. # Verify that headers produce no warnings even under strict settings.
  27. header_warning_test.cc: target
  28. ( (cd target/include && find google/protobuf -name '*.h') | \
  29. awk '{print "#include \""$$1"\""} ' > header_warning_test.cc )
  30. header_warning_test: header_warning_test.cc
  31. # TODO(kenton): Consider adding -pedantic and -Weffc++. Currently these
  32. # produce tons of extra warnings so we'll need to do some work first.
  33. g++ -Itarget/include -Wall -Werror -Wsign-compare -O2 -c header_warning_test.cc
  34. touch header_warning_test