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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. echo "CPUFLAGS_LIST := -DRTE_COMPILE_TIME_CPUFLAGS=" > mk/rte.cpuflags.mk
  34. $(MAKE) O=$(DPDK_STATIC_DIR) build
  35. # Unfortunately the decision about having static or shared libraries is
  36. # made for the whole build, which then produces only .a or .so files
  37. # (but not both).
  38. # And the target layout for target selection has no field for the
  39. # type of library.
  40. # Right now I hack this by doing a second build which only differs in
  41. # the selection of shared libs.
  42. # Shared libs should be default, so the previous static build is only
  43. # used to get static libraries.
  44. cp -a $(DPDK_STATIC_DIR) $(DPDK_SHARED_DIR)
  45. sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \
  46. $(DPDK_SHARED_DIR)/.config
  47. $(MAKE) O=$(DPDK_SHARED_DIR) build
  48. build: build-arch build-indep
  49. binary-indep: PACKAGE_NAME=dpdk-doc
  50. binary-indep: DOCDIR=usr/share/doc/dpdk
  51. binary-indep: export DH_OPTIONS=--indep
  52. binary-indep:
  53. dh_testroot
  54. dh_prep
  55. dh_testdir
  56. dh_installdirs
  57. dh_install
  58. dh_installdocs
  59. dh_installchangelogs
  60. dh_lintian
  61. # Package: dpdk-doc
  62. # All files based on the install-doc rule (includes examples)
  63. $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
  64. DESTDIR=debian/dpdk-doc install-doc
  65. dh_link
  66. dh_compress
  67. dh_fixperms
  68. dh_installdeb
  69. dh_gencontrol
  70. dh_md5sums
  71. dh_builddeb
  72. binary-arch: LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
  73. binary-arch: export DH_OPTIONS=--arch
  74. binary-arch:
  75. dh_testroot
  76. dh_prep
  77. dh_testdir
  78. dh_installdirs
  79. dh_install
  80. dh_installdocs
  81. dh_installchangelogs
  82. dh_lintian
  83. dh_systemd_enable
  84. dh_installinit --no-start --no-restart-on-upgrade
  85. dh_systemd_start --no-start --no-restart-on-upgrade
  86. # Package: dpdk (runtime)
  87. $(MAKE) O=$(DPDK_STATIC_DIR) prefix=/usr \
  88. DESTDIR=debian/dpdk install-runtime
  89. $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
  90. DESTDIR=debian/dpdk install-runtime
  91. cp debian/dpdk.interfaces debian/dpdk/etc/dpdk/interfaces
  92. #rm debian/dpdk/usr/sbin/dpdk_nic_bind
  93. ln -s /usr/share/dpdk/tools/dpdk_nic_bind.py \
  94. debian/dpdk/sbin/dpdk_nic_bind
  95. # Package: libdpdk0 (bare runtime libs)
  96. mkdir -p debian/libdpdk0/$(LIBDIR)
  97. # NOTE so far upstream dpdk has not settled on really versioning the
  98. # combined lib. There are discussions ongoing and various alternative
  99. # approaches.
  100. # We have to wait until that is clarified upstream (in a follow on dpdk
  101. # version).
  102. # One likely solution will make us ship the non combined .so and a
  103. # linker script which replaces the combined lib.
  104. # To easen package management a few notes how this will change if that
  105. # happens:
  106. # NOTE: linker script - this becomes a nop (linker skript has no sover
  107. # on its own)
  108. rm debian/dpdk/usr/lib/libdpdk.so
  109. cp -a $(DPDK_SHARED_DIR)/lib/* debian/libdpdk0/$(LIBDIR)/
  110. # NOTE: linker script - insert basenames loop for all .so's
  111. # NOTE: linker script - we also will need multiple symbol files then
  112. # Package: dpdk-dev (build environment)
  113. $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
  114. DESTDIR=debian/dpdk-dev install-sdk
  115. cp $(DPDK_SHARED_DIR)/.config debian/dpdk-dev/usr/share/dpdk/config
  116. # Package: libdpdk-dev (bare headers and static devel libs)
  117. mkdir -p debian/libdpdk-dev/usr/lib/
  118. # NOTE: linker script - insert basenames loop for all .a's
  119. #ln -s /$(LIBDIR)/libdpdk.so \
  120. # debian/libdpdk-dev/$(LIBDIR)/libdpdk.so.0
  121. cp -a $(DPDK_STATIC_DIR)/lib/* debian/libdpdk-dev/usr/lib/
  122. mv debian/dpdk-dev/usr/include/dpdk debian/libdpdk-dev/usr/include/
  123. # NOTE: linker script - package instead of removing all sublibs
  124. rm -rf debian/dpdk/usr/lib*
  125. dh_python2
  126. dh_perl
  127. dh_link
  128. dh_compress
  129. dh_fixperms
  130. dh_strip
  131. dh_makeshlibs
  132. dh_shlibdeps
  133. dh_installdeb
  134. dh_gencontrol
  135. dh_md5sums
  136. dh_builddeb
  137. binary: binary-arch binary-indep