Makefile.config 2.7 KB

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