GNUmakefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Apt-P2P Clean
  2. #
  3. # Douglas Thrift
  4. #
  5. # $Id$
  6. # Copyright 2010 Douglas Thrift
  7. #
  8. # Licensed under the Apache License, Version 2.0 (the "License");
  9. # you may not use this file except in compliance with the License.
  10. # You may obtain a copy of the License at
  11. #
  12. # http://www.apache.org/licenses/LICENSE-2.0
  13. #
  14. # Unless required by applicable law or agreed to in writing, software
  15. # distributed under the License is distributed on an "AS IS" BASIS,
  16. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # See the License for the specific language governing permissions and
  18. # limitations under the License.
  19. all := apt-p2p-clean.8
  20. tarname := $(shell ./apt-p2p-clean -v | sed -e 's/ /-/g')
  21. prefix := /usr
  22. sbindir := ${prefix}/sbin
  23. man8dir := ${prefix}/share/man/man8
  24. .PHONY: all clean dist install uninstall
  25. all: $(all)
  26. apt-p2p-clean.8: apt-p2p-clean.8.in
  27. %.8: %
  28. help2man -I $@.in -Nn '$(shell sed -e '$$ s/^# //p;d' $<)' -o $@ -s 8 $(shell realpath $<)
  29. clean:
  30. rm -f $(all)
  31. dist: $(all)
  32. bsdtar -cf $(tarname).tar.bz2 -js '#^\.#$(tarname)#' -v --exclude '*.tar.bz2' --exclude '.git*' .
  33. install: $(all)
  34. install -cdv $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
  35. install -cv apt-p2p-clean $(DESTDIR)$(sbindir)/apt-p2p-clean
  36. install -cm 644 -v apt-p2p-clean.8 $(DESTDIR)$(man8dir)/apt-p2p-clean.8
  37. uninstall:
  38. rm -fv $(DESTDIR)$(sbindir)/apt-p2p-clean
  39. rm -fv $(DESTDIR)$(man8dir)/apt-p2p-clean.8