Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright (C) 2002 - 2018 John Goerzen & contributors.
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. # Warning: VERSION, ABBREV and TARGZ are used in docs/build-uploads.sh.
  17. VERSION=$(shell ./offlineimap.py --version)
  18. ABBREV=$(shell git log --format='%h' HEAD~1..)
  19. TARGZ=offlineimap-v$(VERSION)-$(ABBREV)
  20. SHELL=/bin/bash
  21. RST2HTML=`type rst2html >/dev/null 2>&1 && echo rst2html || echo rst2html.py`
  22. all: build
  23. build:
  24. python setup.py build
  25. @echo
  26. @echo "Build process finished, run 'python setup.py install' to install" \
  27. "or 'python setup.py --help' for more information".
  28. clean:
  29. -python setup.py clean --all
  30. -rm -f bin/offlineimapc 2>/dev/null
  31. -find . -name '*.pyc' -exec rm -f {} \;
  32. -find . -name '*.pygc' -exec rm -f {} \;
  33. -find . -name '*.class' -exec rm -f {} \;
  34. -find . -name '.cache*' -exec rm -f {} \;
  35. -find . -type d -name '__pycache__' -exec rm -rf {} \;
  36. -rm -f manpage.links manpage.refs 2>/dev/null
  37. -find . -name auth -exec rm -vf {}/password {}/username \;
  38. -$(MAKE) -C docs clean
  39. .PHONY: docs
  40. docs:
  41. @$(MAKE) -C docs
  42. websitedoc:
  43. @$(MAKE) -C websitedoc
  44. targz: ../$(TARGZ)
  45. ../$(TARGZ):
  46. cd .. && tar -zhcv --transform s,^offlineimap,offlineimap-v$(VERSION), -f $(TARGZ).tar.gz --exclude '.*.swp' --exclude '.*.swo' --exclude '*.pyc' --exclude '__pycache__' offlineimap/{bin,Changelog.md,Changelog.maint.md,contrib,CONTRIBUTING.rst,COPYING,docs,MAINTAINERS.rst,Makefile,MANIFEST.in,offlineimap,offlineimap.conf,offlineimap.conf.minimal,offlineimap.py,README.md,requirements.txt,scripts,setup.cfg,setup.py,snapcraft.yaml,test,tests,TODO.rst}
  47. rpm: targz
  48. cd .. && sudo rpmbuild -ta $(TARGZ)