rules 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/usr/bin/make -f
  2. ## ----------------------------------------------------------------------
  3. ## debian/rules : package script for liblinebreak
  4. ## ----------------------------------------------------------------------
  5. ## ----------------------------------------------------------------------
  6. ## uncomment this to turn on verbose mode
  7. #export DH_VERBOSE=1
  8. ## ----------------------------------------------------------------------
  9. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  10. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  11. ## ----------------------------------------------------------------------
  12. CONFFLAGS =
  13. ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  14. CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
  15. else
  16. CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
  17. endif
  18. ## ----------------------------------------------------------------------
  19. INSTALL = install
  20. INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
  21. INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
  22. INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
  23. INSTALL_DIR = $(INSTALL) -p -o root -g root -m 755 -d
  24. ## ----------------------------------------------------------------------
  25. CFLAGS = -Wall -g -D_REENTRANT
  26. ## ----------------------------------------------------------------------
  27. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  28. CFLAGS += -O0
  29. else
  30. CFLAGS += -O2
  31. endif
  32. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  33. INSTALL_PROGRAM += -s
  34. endif
  35. ## ----------------------------------------------------------------------
  36. TMP_DIR = $(CURDIR)/debian/tmp
  37. ## ----------------------------------------------------------------------
  38. ## targets
  39. clean: configure
  40. dh_testdir
  41. dh_testroot
  42. [ ! -f Makefile ] || $(MAKE) distclean
  43. dh_clean configure-stamp build-stamp install-stamp
  44. configure:
  45. configure-stamp:
  46. dh_testdir
  47. touch configure.in && touch aclocal.m4 && touch configure
  48. CFLAGS="$(CFLAGS)" \
  49. ./configure $(CONFFLAGS) --prefix=/usr
  50. touch configure-stamp
  51. build: build-stamp
  52. build-stamp: configure-stamp
  53. dh_testdir
  54. $(MAKE)
  55. touch build-stamp
  56. install: install-stamp
  57. install-stamp: build
  58. dh_testdir
  59. dh_testroot
  60. dh_clean -k
  61. dh_installdirs
  62. $(MAKE) install prefix=$(TMP_DIR)/usr \
  63. man1dir=$(TMP_DIR)/usr/share/man/man1
  64. touch install-stamp
  65. binary-indep:
  66. binary-arch: build install
  67. dh_testdir
  68. dh_testroot
  69. dh_install -a --sourcedir=$(TMP_DIR)
  70. dh_installdocs -a
  71. dh_installexamples -a
  72. dh_installchangelogs -a ChangeLog
  73. dh_link -a
  74. dh_strip -a
  75. dh_compress -a
  76. dh_fixperms -a
  77. dh_makeshlibs -a -V
  78. dh_installdeb -a
  79. dh_shlibdeps -a -l $(PWD)/debian/liblinebreak/usr/lib
  80. dh_gencontrol -a
  81. dh_md5sums -a
  82. dh_builddeb -a
  83. binary: binary-indep binary-arch
  84. .PHONY: clean build install binary-indep binary-arch binary
  85. ## ----------------------------------------------------------------------