rules 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #! /usr/bin/make -f
  2. #
  3. # debian/rules
  4. # Part of Debian ‘inform6-compiler’ package.
  5. #
  6. # Copyright © 2009–2016 Ben Finney <bignose@debian.org>
  7. #
  8. # This is free software; you may copy, modify, and/or distribute this
  9. # work under the terms of the GNU General Public License as published
  10. # by the Free Software Foundation; version 3 of that License or later.
  11. # No warranty expressed or implied.
  12. # See the file '/usr/share/common-licenses/GPL-3' for details.
  13. export DEB_BUILD_MAINT_OPTIONS = hardening=+all
  14. DPKG_EXPORT_BUILDFLAGS = 1
  15. include /usr/share/dpkg/buildflags.mk
  16. package_resources_dir = /usr/share/inform6
  17. inform_library = ${package_resources_dir}/library
  18. inform_modules = ${package_resources_dir}/modules
  19. export CFLAGS
  20. CFLAGS += -DInclude_Directory="\"${inform_library}\""
  21. CFLAGS += -DModule_Directory="\"${inform_modules}\""
  22. ifeq ($(dpkg-architecture --query DEB_HOST_ARCH_BITS),64)
  23. # From ‘header.h’: “for Unix under gcc”
  24. CFLAGS += -DUNIX
  25. else
  26. # From ‘header.h’: “for 64-bit Unix under gcc”
  27. CFLAGS += -DUNIX64
  28. endif # DEB_HOST_ARCH_BITS
  29. MAKEFILE = ${CURDIR}/Makefile
  30. GENERATED_FILES += ${MAKEFILE}
  31. %:
  32. dh $@
  33. .PHONY: get-packaged-orig-source
  34. get-packaged-orig-source:
  35. $(uscan-download-source) --download-current-version
  36. # Policy §4.9 strongly recommends the ‘get-orig-source’ target:
  37. # “This target is optional, but providing it if possible is a good idea.”
  38. #
  39. # This target is an anomaly: per Policy §4.9, it fetches the *latest*
  40. # upstream source, regardless of this package's version. To fetch the
  41. # upstream source corresponding to this package's *declared* version
  42. # in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
  43. .PHONY: get-orig-source
  44. get-orig-source:
  45. $(uscan-download-source)
  46. get-orig-source get-packaged-orig-source: http_proxy =
  47. get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
  48. get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))
  49. define uscan-download-source
  50. uscan --noconf --verbose \
  51. --force-download \
  52. --rename \
  53. --destdir=$(CURDIR) \
  54. --check-dirname-level=0 ${package_dir}
  55. endef # uscan-download-source
  56. .PHONY: override_dh_auto_clean
  57. override_dh_auto_clean:
  58. dh_auto_clean
  59. $(RM) ${GENERATED_FILES}
  60. .PHONY: override_dh_auto_build
  61. override_dh_auto_build:
  62. cp ${CURDIR}/debian/Makefile.upstream ${MAKEFILE}
  63. dh_auto_build
  64. .PHONY: override_dh_installchangelogs
  65. override_dh_installchangelogs:
  66. dh_installchangelogs ReleaseNotes.html
  67. # Local variables:
  68. # mode: makefile
  69. # coding: utf-8
  70. # End:
  71. # vim: filetype=make fileencoding=utf-8 :