rules 3.7 KB

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