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