Makefile.config 2.6 KB

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