Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. # Copyright (c) 2017 Cadence Design Systems Inc.
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining
  5. # a copy of this software and associated documentation files (the
  6. # "Software"), to deal in the Software without restriction, including
  7. # without limitation the rights to use, copy, modify, merge, publish,
  8. # distribute, sublicense, and/or sell copies of the Software, and to
  9. # permit persons to whom the Software is furnished to do so, subject to
  10. # the following conditions:
  11. #
  12. # The above copyright notice and this permission notice shall be included
  13. # in all copies or substantial portions of the Software.
  14. #
  15. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. #
  23. # Alternatively you can use and distribute this file under the terms of
  24. # the GNU General Public License version 2 or later.
  25. #
  26. ifdef VISYS_SYM_PATH
  27. KBUILD_EXTRA_SYMBOLS += $(VISYS_SYM_PATH)/bm_visys/Module.symvers
  28. else
  29. KBUILD_EXTRA_SYMBOLS += $(shell pwd)/../../../baremetal-drivers/driver/visys/Module.symvers
  30. endif
  31. # export KBUILD_EXTRA_SYMBOLS
  32. EXTRA_CFLAGS += -DWITH_VISYS_KO
  33. xrp-y += xvp_main.o xrp_address_map.o xrp_alloc.o xrp_debug.o
  34. xrp-$(CONFIG_OF) += xrp_firmware.o
  35. xrp-$(CONFIG_CMA) += xrp_cma_alloc.o
  36. obj-$(CONFIG_XRP) += xrp.o
  37. obj-$(CONFIG_XRP_HW_SIMPLE) += xrp_hw_simple.o
  38. obj-m += xrp_hw_comm.o
  39. obj-$(CONFIG_XRP_HW_HIKEY960) += xrp_hw_hikey960.o
  40. ifeq ($(BUILD_TYPE),DEBUG)
  41. EXTRA_CFLAGS += -DDEBUG
  42. endif
  43. KBUILD_CFLAGS += -O2
  44. ccflags-$(CONFIG_XRP_DEBUG) += -DDEBUG
  45. ccflags-$(CONFIG_XRP_HW_HIKEY960) += -I$(srctree)/drivers/hisi/hifi_mailbox
  46. # Remove this comment and all lines below it when integrating this Makefile
  47. # into the linux kernel make system.
  48. #
  49. # sed -i % '/Remove this comment and all lines below it/,$d'
  50. # make -C $(KERNEL) M=$(PWD) modules
  51. # KSRC ?= /lib/modules/$(shell uname -r)/build
  52. modules:
  53. $(MAKE) -C $(KERNEL) M=`pwd` CONFIG_XRP=m CONFIG_XRP_HW_SIMPLE=m CONFIG_XRP_DEBUG=y modules
  54. %:
  55. $(MAKE) -C $(KERNEL) M=`pwd` CONFIG_XRP=m $@