0002-extra-cflags.patch 931 B

1234567891011121314151617181920212223242526272829303132
  1. Makefile: append the CFLAGS to existing ones
  2. Allow the user to pass custom CFLAGS (eg. optimisation flags).
  3. Do not use EXTRA_CFLAGS, append to existing CFLAGS with += (Arnout)
  4. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  5. Cc: Arnout Vandecappelle <arnout@mind.be>
  6. ---
  7. Patch not sent upstream.
  8. Although not specific to buildroot, I am not sure this is the best
  9. way to handle user-supplied CFLAGS.
  10. diff --git a/Makefile b/Makefile
  11. index 962f94eba661..bf6b317158cf 100644
  12. --- a/Makefile
  13. +++ b/Makefile
  14. @@ -16,9 +16,10 @@ LOCAL_VERSION =
  15. CONFIG_LOCALVERSION =
  16. CPPFLAGS = -I libfdt -I .
  17. -WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
  18. +WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
  19. -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
  20. -CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
  21. +CFLAGS ?= -g -Os
  22. +CFLAGS += -fPIC $(WARNINGS)
  23. BISON = bison
  24. LEX = flex