rules 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #!/usr/bin/make -f
  2. # Sample debian/rules that uses debhelper.
  3. # GNU copyright 1997 to 1999 by Joey Hess.
  4. # Uncomment this to turn on verbose mode.
  5. #export DH_VERBOSE=1
  6. # This is the debhelper compatibility version to use.
  7. export DH_COMPAT=4
  8. # This has to be exported to make some magic below work.
  9. export DH_OPTIONS
  10. # These are used for cross-compiling and for saving the configure script
  11. # from having to guess our platform (since we know it already)
  12. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  13. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  14. objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
  15. ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  16. CFLAGS += -g
  17. endif
  18. ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  19. INSTALL_PROGRAM += -s
  20. endif
  21. configure: configure-stamp
  22. configure-stamp:
  23. dh_testdir
  24. # make build directory
  25. mkdir $(objdir)
  26. # run configure with build tree $(objdir)
  27. # change ../configure to ../autogen.sh for CVS build
  28. cd $(objdir) && \
  29. ../configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
  30. --prefix=/usr
  31. touch configure-stamp
  32. build: build-stamp
  33. build-stamp: configure-stamp
  34. dh_testdir
  35. cd $(objdir) && \
  36. $(MAKE)
  37. touch build-stamp
  38. autotools:
  39. OLDDATESUB=`./config.sub -t | tr -d -` ;\
  40. OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
  41. NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
  42. NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
  43. if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
  44. $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
  45. dch -a -p "GNU config automated update: config.sub\
  46. ($$OLDDATESUB to $$NEWDATESUB), config.guess\
  47. ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
  48. cp -f /usr/share/misc/config.sub config.sub ;\
  49. cp -f /usr/share/misc/config.guess config.guess ;\
  50. echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
  51. fi
  52. debian-clean:
  53. dh_testdir
  54. dh_testroot
  55. dh_clean
  56. clean: autotools
  57. dh_testdir
  58. dh_testroot
  59. rm -f build-stamp configure-stamp
  60. # Remove build tree
  61. rm -rf $(objdir)
  62. # if Makefile exists run distclean
  63. if test -f Makefile; then \
  64. $(MAKE) distclean; \
  65. fi
  66. #if test -d CVS; then \
  67. $(MAKE) cvs-clean ;\
  68. fi
  69. dh_clean
  70. install: DH_OPTIONS=
  71. install: build
  72. dh_testdir
  73. dh_testroot
  74. dh_clean -k
  75. dh_installdirs
  76. cd $(objdir) && \
  77. $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
  78. dh_install --list-missing
  79. # This single target is used to build all the packages, all at once, or
  80. # one at a time. So keep in mind: any options passed to commands here will
  81. # affect _all_ packages. Anything you want to only affect one package
  82. # should be put in another target, such as the install target.
  83. binary-common:
  84. dh_testdir
  85. dh_testroot
  86. # dh_installxfonts
  87. dh_installchangelogs
  88. dh_installdocs
  89. dh_installexamples
  90. # dh_installmenu
  91. # dh_installdebconf
  92. # dh_installlogrotate
  93. # dh_installemacsen
  94. # dh_installpam
  95. # dh_installmime
  96. # dh_installinit
  97. # dh_installcron
  98. # dh_installinfo
  99. # dh_undocumented
  100. dh_installman
  101. dh_strip
  102. dh_link
  103. dh_compress
  104. dh_fixperms
  105. dh_makeshlibs -V
  106. dh_installdeb
  107. # dh_perl
  108. dh_shlibdeps
  109. dh_gencontrol
  110. dh_md5sums
  111. dh_builddeb
  112. # Build architecture independant packages using the common target.
  113. binary-indep: build install
  114. # $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
  115. # Build architecture dependant packages using the common target.
  116. binary-arch: build install
  117. $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
  118. # Any other binary targets build just one binary package at a time.
  119. binary-%: build install
  120. $(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
  121. binary: binary-indep binary-arch
  122. .PHONY: build clean binary-indep binary-arch binary install configure