Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #
  2. # Copyright (C) 2010-2012 ARM Limited. All rights reserved.
  3. #
  4. # This program is free software and is provided to you under the terms of the GNU General Public License version 2
  5. # as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
  6. #
  7. # A copy of the licence is included with the program, and can also be obtained from Free Software
  8. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  9. #
  10. # For each arch check: CROSS_COMPILE , KDIR , CFLAGS += -DARCH
  11. export ARCH ?= arm
  12. BUILD ?= debug
  13. TARGET_PLATFORM ?= aml-meson
  14. CONFIG ?= aml-meson-m400-1
  15. BUILD ?= debug
  16. # Check that required parameters are supplied.
  17. ifeq ($(CONFIG),)
  18. $(error "CONFIG must be specified.")
  19. endif
  20. ifeq ($(CPU)$(KDIR),)
  21. $(error "KDIR or CPU must be specified.")
  22. endif
  23. # Get any user defined KDIR-<names> or maybe even a hardcoded KDIR
  24. -include KDIR_CONFIGURATION
  25. # Define host system directory
  26. KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build
  27. ifeq ($(ARCH), arm)
  28. # when compiling for ARM we're cross compiling
  29. export CROSS_COMPILE ?= arm-none-linux-gnueabi-
  30. endif
  31. # look up KDIR based om CPU selection
  32. KDIR ?= $(KDIR-$(CPU))
  33. export CONFIG
  34. export CONFIG_UMP := m
  35. ifeq ($(BUILD),debug)
  36. export CONFIG_UMP_DEBUG := y
  37. else
  38. export CONFIG_UMP_DEBUG := n
  39. endif
  40. ifeq ($(KDIR),)
  41. $(error No KDIR found for platform $(CPU))
  42. endif
  43. all:
  44. $(MAKE) -C $(KDIR) M=$(CURDIR) modules
  45. kernelrelease:
  46. $(MAKE) -C $(KDIR) kernelrelease
  47. clean:
  48. $(MAKE) -C $(KDIR) M=$(CURDIR) clean
  49. $(MAKE) -C $(KDIR) M=$(CURDIR)/../mali clean