rules 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #!/usr/bin/make -f
  2. # Sample debian/rules that uses debhelper.
  3. # GNU copyright 1997 to 1999 by Joey Hess.
  4. #
  5. # Modified to make a template file for a multi-binary package with separated
  6. # build-arch and build-indep targets by Bill Allombert 2001
  7. # Uncomment this to turn on verbose mode.
  8. #export DH_VERBOSE=1
  9. # This is the debhelper compatibility version to use.
  10. export DH_COMPAT=4
  11. # This has to be exported to make some magic below work.
  12. export DH_OPTIONS
  13. # These are used for cross-compiling and for saving the configure script
  14. # from having to guess our platform (since we know it already)
  15. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  16. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  17. objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
  18. CFLAGS = -Wall -g
  19. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  20. CFLAGS += -O0
  21. else
  22. CFLAGS += -O2
  23. endif
  24. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  25. INSTALL_PROGRAM += -s
  26. endif
  27. configure: configure-stamp
  28. configure-stamp:
  29. dh_testdir
  30. # make build directory
  31. mkdir $(objdir)
  32. # run configure with build tree $(objdir)
  33. # change ../configure to ../autogen.sh for CVS build
  34. cd $(objdir) && \
  35. ../configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
  36. --prefix=/usr --enable-static
  37. touch configure-stamp
  38. #Architecture
  39. build: build-arch build-indep
  40. build-arch: build-arch-stamp
  41. build-arch-stamp: configure-stamp
  42. cd $(objdir) && \
  43. $(MAKE)
  44. touch build-arch-stamp
  45. build-indep: build-indep-stamp
  46. build-indep-stamp: configure-stamp
  47. # Add here commands to compile the indep part of the package.
  48. #$(MAKE) doc
  49. touch build-indep-stamp
  50. debian-clean:
  51. dh_testdir
  52. dh_testroot
  53. dh_clean
  54. clean:
  55. dh_testdir
  56. dh_testroot
  57. rm -f build-arch-stamp build-indep-stamp configure-stamp
  58. # Remove build tree
  59. rm -rf $(objdir)
  60. # if Makefile exists run distclean
  61. if test -f Makefile; then \
  62. $(MAKE) distclean; \
  63. fi
  64. #if test -d CVS; then \
  65. $(MAKE) cvs-clean ;\
  66. fi
  67. dh_clean
  68. install: install-indep install-arch
  69. install-indep:
  70. dh_testdir
  71. dh_testroot
  72. # dh_clean -k -i
  73. # dh_installdirs -i
  74. # dh_install -i --list-missing
  75. install-arch:
  76. dh_testdir
  77. dh_testroot
  78. dh_clean -k -s
  79. dh_installdirs -s
  80. cd $(objdir) && \
  81. $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
  82. dh_install -s --list-missing
  83. # Must not depend on anything. This is to be called by
  84. # binary-arch/binary-indep
  85. # in another 'make' thread.
  86. binary-common:
  87. dh_testdir
  88. dh_testroot
  89. dh_installchangelogs
  90. dh_installdocs
  91. dh_installexamples
  92. # dh_installmenu
  93. # dh_installdebconf
  94. # dh_installlogrotate
  95. # dh_installemacsen
  96. # dh_installpam
  97. # dh_installmime
  98. # dh_installinit
  99. # dh_installcron
  100. # dh_installinfo
  101. dh_installman
  102. dh_link
  103. dh_strip
  104. dh_compress
  105. dh_fixperms
  106. # dh_perl
  107. # dh_python
  108. dh_makeshlibs -V
  109. dh_installdeb
  110. dh_shlibdeps -ldebian/libvorbis0a/usr/lib
  111. dh_gencontrol
  112. dh_md5sums
  113. dh_builddeb
  114. # Build architecture independant packages using the common target.
  115. binary-indep: build-indep install-indep
  116. # $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
  117. # Build architecture dependant packages using the common target.
  118. binary-arch: build-arch install-arch
  119. $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
  120. binary: binary-arch binary-indep
  121. .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure