Fuel plugin to deploy OVS with NSH and DPDK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rules 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #!/usr/bin/make -f
  2. # See debhelper(7) (uncomment to enable)
  3. # output every command that modifies files on the build system.
  4. #export DH_VERBOSE = 1
  5. # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
  6. DPKG_EXPORT_BUILDFLAGS = 1
  7. include /usr/share/dpkg/default.mk
  8. DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
  9. # see FEATURE AREAS in dpkg-buildflags(1)
  10. export DEB_BUILD_MAINT_OPTIONS = hardening=+all
  11. # build with debug symbols, dh_strip will create -dgbsyms packages by that
  12. export EXTRA_CFLAGS = -g
  13. # see ENVIRONMENT in dpkg-buildflags(1)
  14. # package maintainers to append CFLAGS
  15. #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
  16. # package maintainers to append LDFLAGS
  17. #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
  18. DPDK_CONFIG = "$(DEB_HOST_GNU_CPU)-native-linuxapp-gcc"
  19. DPDK_STATIC_DIR = "debian/build/static-root"
  20. DPDK_SHARED_DIR = "debian/build/shared-root"
  21. clean:
  22. dh_testdir
  23. rm -rf debian/build debian/tmp
  24. dh_clean
  25. build-config:
  26. dh_testdir
  27. $(MAKE) O=$(DPDK_STATIC_DIR) T=$(DPDK_CONFIG) config
  28. build-indep: build-config
  29. dh_testdir
  30. $(MAKE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html
  31. build-arch: build-config
  32. dh_testdir
  33. $(MAKE) O=$(DPDK_STATIC_DIR) build
  34. # Unfortunately the decision about having static or shared libraries is
  35. # made for the whole build, which then produces only .a or .so files
  36. # (but not both).
  37. # And the target layout for target selection has no field for the
  38. # type of library.
  39. # Right now I hack this by doing a second build which only differs in
  40. # the selection of shared libs.
  41. # Shared libs should be default, so the previous static build is only
  42. # used to get static libraries.
  43. cp -a $(DPDK_STATIC_DIR) $(DPDK_SHARED_DIR)
  44. sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \
  45. $(DPDK_SHARED_DIR)/.config
  46. $(MAKE) O=$(DPDK_SHARED_DIR) build
  47. build: build-arch build-indep
  48. binary-indep: PACKAGE_NAME=dpdk-doc
  49. binary-indep: DOCDIR=usr/share/doc/dpdk
  50. binary-indep: export DH_OPTIONS=--indep
  51. binary-indep:
  52. dh_testroot
  53. dh_prep
  54. dh_testdir
  55. dh_installdirs
  56. dh_install
  57. dh_installdocs
  58. dh_installchangelogs
  59. dh_lintian
  60. # Package: dpdk-doc
  61. # All files based on the install-doc rule (includes examples)
  62. $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
  63. DESTDIR=debian/dpdk-doc install-doc
  64. dh_link
  65. dh_compress
  66. dh_fixperms
  67. dh_installdeb
  68. dh_gencontrol
  69. dh_md5sums
  70. dh_builddeb
  71. binary-arch: LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
  72. binary-arch: export DH_OPTIONS=--arch
  73. binary-arch:
  74. dh_testroot
  75. dh_prep
  76. dh_testdir
  77. dh_installdirs
  78. dh_install
  79. dh_installdocs
  80. dh_installchangelogs
  81. dh_lintian
  82. dh_systemd_enable
  83. dh_installinit --no-start --no-restart-on-upgrade
  84. dh_systemd_start --no-start --no-restart-on-upgrade
  85. # Package: dpdk (runtime)
  86. $(MAKE) O=$(DPDK_STATIC_DIR) prefix=/usr \
  87. DESTDIR=debian/dpdk install-runtime
  88. $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
  89. DESTDIR=debian/dpdk install-runtime
  90. cp debian/dpdk.interfaces debian/dpdk/etc/dpdk/interfaces
  91. #rm debian/dpdk/usr/sbin/dpdk_nic_bind
  92. ln -s /usr/share/dpdk/tools/dpdk_nic_bind.py \
  93. debian/dpdk/sbin/dpdk_nic_bind
  94. # Package: libdpdk0 (bare runtime libs)
  95. mkdir -p debian/libdpdk0/$(LIBDIR)
  96. # NOTE so far upstream dpdk has not settled on really versioning the
  97. # combined lib. There are discussions ongoing and various alternative
  98. # approaches.
  99. # We have to wait until that is clarified upstream (in a follow on dpdk
  100. # version).
  101. # One likely solution will make us ship the non combined .so and a
  102. # linker script which replaces the combined lib.
  103. # To easen package management a few notes how this will change if that
  104. # happens:
  105. # NOTE: linker script - this becomes a nop (linker skript has no sover
  106. # on its own)
  107. rm debian/dpdk/usr/lib/libdpdk.so
  108. cp -a $(DPDK_SHARED_DIR)/lib/* debian/libdpdk0/$(LIBDIR)/
  109. # NOTE: linker script - insert basenames loop for all .so's
  110. # NOTE: linker script - we also will need multiple symbol files then
  111. # Package: dpdk-dev (build environment)
  112. $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
  113. DESTDIR=debian/dpdk-dev install-sdk
  114. cp $(DPDK_SHARED_DIR)/.config debian/dpdk-dev/usr/share/dpdk/config
  115. # Package: libdpdk-dev (bare headers and static devel libs)
  116. mkdir -p debian/libdpdk-dev/usr/lib/
  117. # NOTE: linker script - insert basenames loop for all .a's
  118. #ln -s /$(LIBDIR)/libdpdk.so \
  119. # debian/libdpdk-dev/$(LIBDIR)/libdpdk.so.0
  120. cp -a $(DPDK_STATIC_DIR)/lib/* debian/libdpdk-dev/usr/lib/
  121. mv debian/dpdk-dev/usr/include/dpdk debian/libdpdk-dev/usr/include/
  122. # NOTE: linker script - package instead of removing all sublibs
  123. rm -rf debian/dpdk/usr/lib*
  124. dh_python2
  125. dh_perl
  126. dh_link
  127. dh_compress
  128. dh_fixperms
  129. dh_strip
  130. dh_makeshlibs
  131. dh_shlibdeps
  132. dh_installdeb
  133. dh_gencontrol
  134. dh_md5sums
  135. dh_builddeb
  136. binary: binary-arch binary-indep