engine_control/config/make/rules.mk
2016-07-29 09:01:02 +02:00

71 lines
1.5 KiB
Makefile
Executable File

.PHONY: clean distclean doc
ROOT_DIR := $(shell pwd | sed "s/\/source//g")
ifeq ($(BOARD), stm32f4-discovery)
include $(ROOT_DIR)/config/make/stm32f4xx.mk
endif
INCLUDES += $(SRC_DIR)/os/$(DBG_REL_DIR)/include
LIB_DIR += $(SRC_DIR)/os/$(DBG_REL_DIR)
OS_LIB = kosmos-$(ARCH)-$(BOARD)$(DBG_EXT)
LIBS += $(OS_LIB)
CFLAGS += \
-O$(OPTIM) \
$(addprefix -I, $(INCLUDES)) \
-Wall
CPPCHECK_FLAGS += \
--template=gcc \
--error-exitcode=1 \
--enable=warning,performance,information,style \
--inline-suppr \
$(addprefix -I, $(INCLUDES))
include $(ROOT_DIR)/config/make/tools.mk
SRC_DIR = $(ROOT_DIR)/source
DBG_REL_DIR = release
ifeq ($(DEBUG),y)
DBG_REL_DIR = debug
endif
OBJ_DIR = $(ROOT_DIR)/release/object/$(ARCH)/$(DBG_REL_DIR)
EXE_DIR = $(ROOT_DIR)/release/execute/$(ARCH)/$(DBG_REL_DIR)
MAP_DIR = $(ROOT_DIR)/release/map/$(ARCH)/$(DBG_REL_DIR)
SIZE_DIR = $(ROOT_DIR)/release/size/$(ARCH)/$(DBG_REL_DIR)
DOC_DIR = $(ROOT_DIR)/doc/$(ARCH)
TEST_OBJ_DIR = $(ROOT_DIR)/test/object
TEST_EXE_DIR = $(ROOT_DIR)/test/execute/
DOC_SRC :=
ELF_EXT = .elf
BIN_EXT = .bin
HEX_EXT = .hex
LIB_EXT = .a
SIZE_EXT = .size
TEST_EXT =
DOXYFILE=$(ROOT_DIR)/config/doxygen/Doxyfile
define makedep
$(CC) -MM \
-MF $3 \
-MP \
-MT $2 \
$(CFLAGS) \
$1
endef
define maketestdep
$(NATIVE_CC) -MM \
-MF $3 \
-MP \
-MT $2 \
$(TEST_CFLAGS) \
$1
endef