rules 3.6 KB

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