rules 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 compatability version to use.
  7. export DH_COMPAT=1
  8. #include version
  9. major=$(shell grep '^MAJOR_VERSION' Rules.mak|sed 's/.*=//')
  10. minor=$(shell grep '^MINOR_VERSION' Rules.mak|sed 's/.*=//')
  11. version:=$(strip $(major)).$(strip $(minor))
  12. target=$(DEB_HOST_GNU_CPU)
  13. #target=powerpc
  14. with_shared_libs=y
  15. #ifeq ($(target),powerpc)
  16. #with_shared_libs=n
  17. #endif
  18. build: build-stamp
  19. build-stamp:
  20. dh_testdir
  21. # Add here commands to compile the package.
  22. cp extra/Configs/Config.$(target) Config
  23. echo '#Debian configuration overrides' >>Config
  24. ifneq ($(target),$(DEB_HOST_GNU_CPU))
  25. echo 'TARGET_ARCH = $(target)' >>Config
  26. echo 'CROSS = $(target)-linux-' >>Config
  27. endif
  28. echo 'DOPIC = true' >>Config
  29. echo 'PREFIX = $$(DESTDIR)/usr' >>Config
  30. echo 'DEVEL_PREFIX = $$(PREFIX)/$$(TARGET_ARCH)-linux-uclibc' >>Config
  31. echo 'TARGET_PREFIX = $$(DESTDIR)/' >>Config
  32. ifeq ($(with_shared_libs),n)
  33. echo 'HAVE_SHARED = false' >>Config
  34. endif
  35. $(MAKE)
  36. touch build-stamp
  37. clean:
  38. dh_testdir
  39. dh_testroot
  40. rm -f build-stamp
  41. # Add here commands to clean up after the build process.
  42. -$(MAKE) clean
  43. dh_clean
  44. install: build
  45. dh_testdir
  46. dh_testroot
  47. dh_clean -k
  48. dh_installdirs
  49. # Add here commands to install the package into debian/tmp.
  50. $(MAKE) install_dev DESTDIR=`pwd`/debian/tmp
  51. $(MAKE) install_runtime DESTDIR=`pwd`/debian/libuclibc0
  52. $(MAKE) install_gcc DESTDIR=`pwd`/debian/uclibc-gcc
  53. install -m 644 debian/uclibc-gcc.1 \
  54. debian/uclibc-gcc/usr/share/man/man1/$(target)-uclibc-gcc.1
  55. (cd debian/uclibc-gcc/usr/share/man/man1; \
  56. ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-cc.1.gz; \
  57. ln -sf $(target)-uclibc-gcc.1.gz $(target)-uclibc-ld.1.gz; \
  58. for x in addr2line ar as cpp gasp nm objcopy objdump ranlib \
  59. size strings strip;do \
  60. ln -sf $$x.1.gz $(target)-uclibc-$$x.1.gz;done)
  61. install -d debian/libuclibc0/usr/share/man/man1
  62. install -m 644 debian/uclibc-ldd.1 \
  63. debian/libuclibc0/usr/share/man/man1/$(target)-uclibc-ldd.1
  64. install -m 644 debian/uclibc-ldconfig.1 \
  65. debian/libuclibc0/usr/share/man/man1/$(target)-uclibc-ldconfig.1
  66. ifeq ($(with_shared_libs),y)
  67. mkdir -p debian/libuclibc0/lib/
  68. ln -sf /usr/$(target)-uclibc-linux/lib/ld-uclibc.so.0 \
  69. debian/libuclibc0/lib/ld-uclibc.so.0
  70. endif
  71. # Build architecture-independent files here.
  72. binary-indep: build install
  73. # We have nothing to do by default.
  74. # Build architecture-dependent files here.
  75. binary-arch: build install
  76. # dh_testversion
  77. dh_testdir
  78. dh_testroot
  79. # dh_installdebconf
  80. dh_installdocs
  81. dh_installexamples
  82. dh_installmenu
  83. # dh_installemacsen
  84. # dh_installpam
  85. # dh_installinit
  86. dh_installcron
  87. # dh_installmanpages -plibuclibc0
  88. dh_installinfo
  89. # dh_undocumented
  90. dh_installchangelogs
  91. dh_link
  92. dh_strip
  93. dh_compress
  94. dh_fixperms -Xld-uclibc
  95. # You may want to make some executables suid here.
  96. # dh_suidregister
  97. # dh_makeshlibs
  98. dh_installdeb
  99. # dh_perl
  100. dh_shlibdeps --exclude=ld_uclibc -ldebian/libuclibc0/usr/$(target)-linux-uclibc/lib
  101. dh_gencontrol
  102. dh_md5sums
  103. dh_builddeb
  104. binary: binary-indep binary-arch
  105. .PHONY: build clean binary-indep binary-arch binary install