Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.07 KB | None | 0 0
  1. ################################################################################
  2. #
  3. # Intel(R) 10GbE PCI Express Linux Network Driver
  4. # Copyright(c) 1999 - 2017 Intel Corporation.
  5. #
  6. # This program is free software; you can redistribute it and/or modify it
  7. # under the terms and conditions of the GNU General Public License,
  8. # version 2, as published by the Free Software Foundation.
  9. #
  10. # This program is distributed in the hope it will be useful, but WITHOUT
  11. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  13. # more details.
  14. #
  15. # The full GNU General Public License is included in this distribution in
  16. # the file called "COPYING".
  17. #
  18. # Contact Information:
  19. # Linux NICS <linux.nics@intel.com>
  20. # e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  21. # Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  22. #
  23. ################################################################################
  24.  
  25. ifneq ($(KERNELRELEASE),)
  26. # kbuild part of makefile
  27. #
  28. # Makefile for the Intel(R) 10GbE PCI Express Linux Network Driver
  29. #
  30.  
  31. obj-$(CONFIG_IXGBE) += ixgbe.o
  32.  
  33. define ixgbe-y
  34.     ixgbe_main.o
  35.     ixgbe_api.o
  36.     ixgbe_common.o
  37.     ixgbe_dcb.o
  38.     ixgbe_dcb_82598.o
  39.     ixgbe_dcb_82599.o
  40.     ixgbe_ethtool.o
  41.     ixgbe_lib.o
  42.     ixgbe_mbx.o
  43.     ixgbe_sriov.o
  44.     ixgbe_param.o
  45.     ixgbe_phy.o
  46.     ixgbe_procfs.o
  47.     ixgbe_82598.o
  48.     ixgbe_82599.o
  49.     ixgbe_x540.o
  50.     ixgbe_x550.o
  51. endef
  52. ixgbe-y := $(strip ${ixgbe-y})
  53.  
  54. ixgbe-${CONFIG_DCB} += ixgbe_dcb_nl.o
  55.  
  56. ixgbe-${CONFIG_DEBUG_FS} += ixgbe_debugfs.o
  57.  
  58. ixgbe-${CONFIG_FCOE:m=y} += ixgbe_fcoe.o
  59.  
  60. ixgbe-$(CONFIG_PTP_1588_CLOCK:m=y) += ixgbe_ptp.o
  61.  
  62. ixgbe-${CONFIG_SYSFS} += ixgbe_sysfs.o
  63.  
  64. ixgbe-y += kcompat.o
  65.  
  66. else    # ifneq($(KERNELRELEASE),)
  67. # normal makefile
  68.  
  69. DRIVER := ixgbe
  70.  
  71. ifeq (,$(wildcard common.mk))
  72.   $(error Cannot find common.mk build rules)
  73. else
  74.   include common.mk
  75. endif
  76.  
  77. # Check that kernel version is at least 2.6.0, since we don't support 2.4.x
  78. # kernels with the ixgbe driver. We can't use minimum_kver_check since SLES 10
  79. # SP4's Make has a bug which causes $(eval) inside an ifeq conditional to error
  80. # out. This was fixed in Make 3.81, but SLES 10 SP4 does not have a fix for
  81. # this yet.
  82. ifeq (0,$(shell [ ${KVER_CODE} -lt $(call get_kvercode,2,6,0) ]; echo "$?"))
  83.   $(warning *** Aborting the build.)
  84.   $(error This driver is not supported on kernel versions older than 2.6.0)
  85. endif
  86.  
  87. ######################
  88. # Kernel Build Macro #
  89. ######################
  90.  
  91. # customized kernelbuild function
  92. #
  93. # ${1} is the kernel build target
  94. # ${2} may contain extra rules to pass to kernelbuild macro
  95. #
  96. # We customize the kernelbuild target in order to provide our hack to disable
  97. # CONFIG_PTP_1588_CLOCK support should -DNO_PTP_SUPPORT be defined in the extra
  98. # cflags given on the command line.
  99. devkernelbuild = $(call kernelbuild,$(if $(filter -DNO_PTP_SUPPORT,${EXTRA_CFLAGS}),CONFIG_PTP_1588_CLOCK=n) ${2},${1})
  100.  
  101. ###############
  102. # Build rules #
  103. ###############
  104.  
  105. # Standard compilation, with regular output
  106. default:
  107.     @+$(call devkernelbuild,modules)
  108.  
  109. # Noisy output, for extra debugging
  110. noisy:
  111.     @+$(call devkernelbuild,modules,V=1)
  112.  
  113. # Silence any output generated
  114. silent:
  115.     @+$(call devkernelbuild,modules,>/dev/null)
  116.  
  117. # Enable higher warning level
  118. checkwarnings: clean
  119.     @+$(call devkernelbuild,modules,W=1)
  120.  
  121. # Run sparse static analyzer
  122. sparse: clean
  123.     @+$(call devkernelbuild,modules,C=2 CF="-D__CHECK_ENDIAN__ -Wbitwise -Wcontext")
  124.  
  125. # Run coccicheck static analyzer
  126. ccc: clean
  127.     @+$(call devkernelbuild,modules,coccicheck MODE=report))
  128.  
  129. # Build manfiles
  130. manfile:
  131.     @gzip -c ../${DRIVER}.${MANSECTION} > ${DRIVER}.${MANSECTION}.gz
  132.  
  133. # Clean the module subdirectories
  134. clean:
  135.     @+$(call devkernelbuild,clean)
  136.     @-rm -rf *.${MANSECTION}.gz *.ko
  137.  
  138. # Install the modules and manpage
  139. install: default manfile
  140.     @echo "Copying manpages..."
  141.     @install -D -m 644 ${DRIVER}.${MANSECTION}.gz ${INSTALL_MOD_PATH}${MANDIR}/man${MANSECTION}/${DRIVER}.${MANSECTION}.gz
  142.     @echo "Installing modules..."
  143.     @+$(call devkernelbuild,modules_install)
  144.     @echo "Running depmod..."
  145.     @$(call cmd_depmod)
  146.  
  147. uninstall:
  148.     rm -f ${INSTALL_MOD_PATH}/lib/modules/${KVER}/${INSTALL_MOD_DIR}/${DRIVER}.ko;
  149.     $(call cmd_depmod)
  150.     if [ -e ${INSTALL_MOD_PATH}${MANDIR}/man${MANSECTION}/${DRIVER}.${MANSECTION}.gz ] ; then \
  151.         rm -f ${INSTALL_MOD_PATH}${MANDIR}/man${MANSECTION}/${DRIVER}.${MANSECTION}.gz ; \
  152.     fi;
  153.  
  154. ########
  155. # Help #
  156. ########
  157. help:
  158.     @echo 'Cleaning targets:'
  159.     @echo '  clean               - Clean files generated by kernel module build'
  160.     @echo 'Build targets:'
  161.     @echo '  default             - Build module(s) with standard verbosity'
  162.     @echo '  noisy               - Build module(s) with V=1 verbosity -- very noisy'
  163.     @echo '  silent              - Build module(s), squelching all output'
  164.     @echo 'Static Analysis:'
  165.     @echo '  checkwarnings       - Clean, then build module(s) with W=1 warnings enabled'
  166.     @echo '  sparse              - Clean, then check module(s) using sparse'
  167.     @echo '  ccc                 - Clean, then check module(s) using coccicheck'
  168.     @echo 'Other targets:'
  169.     @echo '  manfile             - Generate a gzipped manpage'
  170.     @echo '  install             - Build then install the module(s) and manpage'
  171.     @echo '  uninstall           - Uninstall the module(s) and manpage'
  172.     @echo '  help                - Display this help message'
  173.     @echo 'Variables:'
  174.     @echo '  LINUX_VERSION       - Debug tool to force kernel LINUX_VERSION_CODE. Use at your own risk.'
  175.     @echo '  W=N                 - Kernel variable for setting warning levels'
  176.     @echo '  V=N                 - Kernel variable for setting output verbosity'
  177.     @echo '  INSTALL_MOD_PATH    - Add prefix for the module and manpage installation path'
  178.     @echo '  INSTALL_MOD_DIR     - Use module directory other than updates/drivers/net/ethernet/intel/${DRIVER}'
  179.     @echo ' Other variables may be available for tuning make process, see'
  180.     @echo ' Kernel Kbuild documentation for more information'
  181.  
  182. .PHONY: default noisy clean manfile silent sparse ccc install uninstall help
  183.  
  184. endif   # ifneq($(KERNELRELEASE),)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement