diff options
| author | hathach <[email protected]> | 2019-05-02 20:30:44 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-02 20:30:44 +0700 |
| commit | 867e69ed9d1ef44a7574ccf6543c8a46ef8d8e6c (patch) | |
| tree | 59b0e0aad89d7735585737be52fd2daffdbab5c0 /examples/make.mk | |
| parent | 2341ecb4188b1998e1e682a09e9b04570929a5a4 (diff) | |
| parent | 7e2088765daf15f59f43c9e7cffb46b9ae997e19 (diff) | |
Merge pull request #61 from hathach/develop
enhance HID, add HID out endpoint support
Diffstat (limited to 'examples/make.mk')
| -rw-r--r-- | examples/make.mk | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/examples/make.mk b/examples/make.mk new file mode 100644 index 000000000..d76f611fb --- /dev/null +++ b/examples/make.mk @@ -0,0 +1,65 @@ +# +# Common make definition for all examples +# + +# Compiler +CROSS_COMPILE = arm-none-eabi- +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +OBJCOPY = $(CROSS_COMPILE)objcopy +SIZE = $(CROSS_COMPILE)size +MKDIR = mkdir +SED = sed +CP = cp +RM = rm + +# Select the board to build for. +ifeq ($(BOARD),) + $(info You must provide a BOARD parameter with 'BOARD=') + $(info Possible values are:) + $(info $(sort $(subst /.,,$(subst $(TOP)/hw/bsp/,,$(wildcard $(TOP)/hw/bsp/*/.))))) + $(error BOARD not defined) +else + ifeq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/.),) + $(error Invalid BOARD specified) + endif +endif + +# Build directory +BUILD = build-$(BOARD) + +# Board specific +include $(TOP)/hw/bsp/$(BOARD)/board.mk + +# Compiler Flags +CFLAGS += \ + -fsingle-precision-constant \ + -fno-strict-aliasing \ + -Wdouble-promotion \ + -Wno-endif-labels \ + -Wstrict-prototypes \ + -Wall \ + -Werror \ + -Werror-implicit-function-declaration \ + -Wfloat-equal \ + -Wundef \ + -Wshadow \ + -Wwrite-strings \ + -Wsign-compare \ + -Wmissing-format-attribute \ + -Wno-deprecated-declarations \ + -Wnested-externs \ + -Wunreachable-code \ + -Wno-error=lto-type-mismatch \ + -ffunction-sections \ + -fdata-sections + +# This causes lots of warning with nrf5x build due to nrfx code +# CFLAGS += -Wcast-align + +# Debugging/Optimization +ifeq ($(DEBUG), 1) + CFLAGS += -O0 -ggdb +else + CFLAGS += -flto -Os +endif |
