lufa-gcc.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # LUFA Library
  3. # Copyright (C) Dean Camera, 2015.
  4. #
  5. # dean [at] fourwalledcubicle [dot] com
  6. # www.lufa-lib.org
  7. #
  8. DMBS_BUILD_MODULES += LUFA_GCC
  9. DMBS_BUILD_TARGETS +=
  10. DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH F_USB
  11. DMBS_BUILD_OPTIONAL_VARS += BOARD
  12. DMBS_BUILD_PROVIDED_VARS +=
  13. DMBS_BUILD_PROVIDED_MACROS +=
  14. SHELL = /bin/sh
  15. ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
  16. ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
  17. ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
  18. # Sanity check user supplied values
  19. $(call ERROR_IF_EMPTY, LUFA_PATH)
  20. $(call ERROR_IF_EMPTY, ARCH)
  21. $(call ERROR_IF_EMPTY, F_USB)
  22. # Default values of optionally user-supplied variables
  23. BOARD ?= NONE
  24. # Determine the utility prefix to use for the selected architecture
  25. ifeq ($(ARCH), XMEGA)
  26. $(warning The XMEGA device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
  27. else ifeq ($(ARCH), UC3)
  28. $(warning The UC3 device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
  29. endif
  30. # Common LUFA C/C++ includes/definitions
  31. LUFA_CXX_INCLUDES = -I. -I$(patsubst %/,%,$(LUFA_PATH))/..
  32. LUFA_CXX_DEFINES = -DARCH=ARCH_$(ARCH) -DBOARD=BOARD_$(BOARD) -DF_USB=$(F_USB)UL
  33. # LUFA specific standard build options
  34. C_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS)
  35. CPP_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS)