rules 4.1 KB

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