common.mk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Functionality common to both top-level project makefile
  2. # and component makefiles
  3. #
  4. # Include project config file, if it exists.
  5. #
  6. # (Note that we only rebuild auto.conf automatically for some targets,
  7. # see project_config.mk for details.)
  8. -include $(PROJECT_PATH)/build/include/config/auto.conf
  9. ifeq ("$(LDFLAGS)","")
  10. LDFLAGS = -nostdlib \
  11. -L$(SDK_PATH)/lib \
  12. -L$(SDK_PATH)/ld \
  13. $(addprefix -L$(BUILD_DIR_BASE)/,$(COMPONENTS) $(SRCDIRS)) \
  14. -u call_user_start_cpu0 \
  15. -Wl,--gc-sections \
  16. -Wl,-static \
  17. -Wl,--start-group \
  18. $(COMPONENT_LDFLAGS) \
  19. -lgcc \
  20. -Wl,--end-group
  21. endif
  22. ifeq ("$(CFLAGS)","")
  23. CFLAGS = -DESP_PLATFORM -Og -std=gnu99 -g3 \
  24. -Wpointer-arith -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable \
  25. -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -Wall -ffunction-sections -fdata-sections $(EXTRA_CFLAGS)
  26. endif
  27. ifeq ("$(CXXFLAGS)","")
  28. CXXFLAGS = -DESP_PLATFORM -Og -std=gnu++11 -g3 \
  29. -Wpointer-arith -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable \
  30. -Wl,-EL -nostdlib -mlongcalls -Wall -ffunction-sections -fdata-sections $(EXTRA_CFLAGS) -fno-exceptions
  31. endif
  32. #Handling of V=1/VERBOSE=1 flag
  33. V ?= $(VERBOSE)
  34. ifeq ("$(V)","1")
  35. Q :=
  36. vecho := @true
  37. else
  38. Q := @
  39. vecho := @echo
  40. endif
  41. # General make utilities
  42. # convenience variable for printing an 80 asterisk wide separator line
  43. SEPARATOR:="*******************************************************************************"
  44. # macro to remove quotes from an argument, ie $(call dequote (CONFIG_BLAH))
  45. define dequote
  46. $(subst ",,$(1))
  47. endef
  48. # " comment kept here to keep syntax highlighting happy