Makefile 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #############################################################################
  2. #
  3. # The MIT License (MIT)
  4. #
  5. # Copyright (c) 2014 - 2021 VERISILICON
  6. #
  7. # Permission is hereby granted, free of charge, to any person obtaining a
  8. # copy of this software and associated documentation files (the "Software"),
  9. # to deal in the Software without restriction, including without limitation
  10. # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. # and/or sell copies of the Software, and to permit persons to whom the
  12. # Software is furnished to do so, subject to the following conditions:
  13. #
  14. # The above copyright notice and this permission notice shall be included in
  15. # all copies or substantial portions of the Software.
  16. #
  17. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  23. # DEALINGS IN THE SOFTWARE.
  24. #
  25. #############################################################################
  26. #
  27. # The GPL License (GPL)
  28. #
  29. # Copyright (C) 2014 - 2021 VERISILICON
  30. #
  31. # This program is free software; you can redistribute it and/or
  32. # modify it under the terms of the GNU General Public License
  33. # as published by the Free Software Foundation; either version 2
  34. # of the License, or (at your option) any later version.
  35. #
  36. # This program is distributed in the hope that it will be useful,
  37. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. # GNU General Public License for more details.
  40. #
  41. # You should have received a copy of the GNU General Public License
  42. # along with this program; if not, write to the Free Software Foundation,
  43. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  44. #
  45. #############################################################################
  46. #
  47. # Note: This software is released under dual MIT and GPL licenses. A
  48. # recipient may use this file under the terms of either the MIT license or
  49. # GPL License. If you wish to use only one license not the other, you can
  50. # indicate your decision by deleting one of the above license notices in your
  51. # version of this file.
  52. #
  53. ##############################################################################
  54. DEBUG ?= n
  55. ifeq ($(DEBUG),y)
  56. DEBFLAGS = -O -g -DHANTRODEC_DEBUG
  57. DEBFLAGS += -DHANTROMMU_DEBUG
  58. else
  59. DEBFLAGS = -O2
  60. endif
  61. EXTRA_CFLAGS += $(DEBFLAGS)
  62. EXTRA_CFLAGS += -I$(PWD)/../dwl
  63. # EXTRA_CFLAGS += -DDYNAMIC_MALLOC_VCMDNODE
  64. ifneq ($(KERNELRELEASE),)
  65. # recursive call from kernel build system
  66. hantrodec-objs := hantro_dec.o hantro_mmu.o hantro_axife.o hantro_vcmd.o bidirect_list.o vcmdswhwregisters.o subsys.o kernel_allocator.o
  67. obj-m += hantrodec.o
  68. else
  69. #KDIR := /mnt/export/Testing/Board_Version_Control/SW_Common/SOCLE_MDK-3D/openlinux/2.6.29/v0_5/android_linux-2.6.29
  70. KVER := $(shell uname -r)
  71. KDIR := /lib/modules/$(KVER)/build
  72. PWD := $(shell pwd)
  73. all:
  74. $(MAKE) -C $(KDIR) M=$(PWD) modules
  75. endif
  76. clean:
  77. rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
  78. rm -rf modules.order Module.symvers