Makefile.config 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. # tools/power/acpi/Makefile.config - ACPI tool Makefile
  3. #
  4. # Copyright (c) 2015, Intel Corporation
  5. # Author: Lv Zheng <lv.zheng@intel.com>
  6. #
  7. ifeq ($(srctree),)
  8. srctree := $(patsubst %/,%,$(dir $(shell pwd)))
  9. srctree := $(patsubst %/,%,$(dir $(srctree)))
  10. #$(info Determined 'srctree' to be $(srctree))
  11. endif
  12. include $(srctree)/../../scripts/Makefile.include
  13. OUTPUT=$(srctree)/
  14. ifeq ("$(origin O)", "command line")
  15. OUTPUT := $(O)/tools/power/acpi/
  16. endif
  17. #$(info Determined 'OUTPUT' to be $(OUTPUT))
  18. # --- CONFIGURATION BEGIN ---
  19. # Set the following to `true' to make a unstripped, unoptimized
  20. # binary. Leave this set to `false' for production use.
  21. DEBUG ?= true
  22. # make the build silent. Set this to something else to make it noisy again.
  23. V ?= false
  24. # Prefix to the directories we're installing to
  25. DESTDIR ?=
  26. # --- CONFIGURATION END ---
  27. # Directory definitions. These are default and most probably
  28. # do not need to be changed. Please note that DESTDIR is
  29. # added in front of any of them
  30. bindir ?= /usr/bin
  31. sbindir ?= /usr/sbin
  32. mandir ?= /usr/man
  33. # Toolchain: what tools do we use, and what options do they need:
  34. INSTALL = /usr/bin/install -c
  35. INSTALL_PROGRAM = ${INSTALL}
  36. INSTALL_DATA = ${INSTALL} -m 644
  37. INSTALL_SCRIPT = ${INSTALL_PROGRAM}
  38. # If you are running a cross compiler, you may want to set this
  39. # to something more interesting, like "arm-linux-". If you want
  40. # to compile vs uClibc, that can be done here as well.
  41. CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
  42. CROSS_COMPILE ?= $(CROSS)
  43. LD = $(CC)
  44. # check if compiler option is supported
  45. cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
  46. # use '-Os' optimization if available, else use -O2
  47. OPTIMIZATION := $(call cc-supports,-Os,-O2)
  48. WARNINGS := -Wall
  49. WARNINGS += $(call cc-supports,-Wstrict-prototypes)
  50. WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
  51. KERNEL_INCLUDE := $(OUTPUT)include
  52. ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
  53. CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
  54. CFLAGS += $(WARNINGS)
  55. ifeq ($(strip $(V)),false)
  56. QUIET=@
  57. ECHO=@echo
  58. else
  59. QUIET=
  60. ECHO=@\#
  61. endif
  62. # if DEBUG is enabled, then we do not strip or optimize
  63. ifeq ($(strip $(DEBUG)),true)
  64. CFLAGS += -O1 -g -DDEBUG
  65. STRIPCMD = /bin/true -Since_we_are_debugging
  66. else
  67. CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
  68. STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
  69. endif