📄 nucleus.mak
字号:
# Nucleus and compiler definitions
# Currently only supports diab compiler
# NUCLEUS_ROOT must be defined in the environment
# Check for required definitions
ifndef NUCLEUS_ROOT
$(error NUCLEUS_ROOT is not defined. It must be set to the Nucleus root directory)
endif
# Indicate if executable targets can be built for this OS via these makefiles
# Set to yes if they can be built, no if they can't.
BUILD_EXECUTABLE := no
# Extention to target name for executable (ie .exe for Windows)
EXECUTE_EXTENTION :=
# Add required info to master lists
# MAKE_LIST - List any OS dependent makefiles (inclduing this one)
# INCLUDE_DIRS - List any OS dependent include directories in search order
# LIBS_LIST - List any OS dependent libraries needed to link executables
MAKE_LIST += nucleus.mak
INCLUDE_DIRS += $(NUCLEUS_ROOT) $(NUCLEUS_ROOT)/Plus $(NUCLEUS_ROOT)/Net $(NUCLEUS_ROOT)/Net/Inc
LIBS_LIST += plus net fec
LIB_DIRS += $(NUCLEUS_ROOT)/Lib
ifeq ($(COMPILER), diab)
# Compiler setup - DIAB
CC := dcc -t$(COMPILER_CPU):simple -D_NUCLEUS -Xansi
INCLUDE_FLAG := -I
C_DEBUGFLAG := -g -DNU_DEBUG
C_OPTFLAG := -XO
CFLAGS +=
OBJ_EXTENTION := .o
AR := dar
ARFLAGS := -r
LIB_EXTENTION := .a
LINK := dcc -t$(COMPILER_CPU):simple -Xsuppress-dot -Xreloc-bug -m2 -e _START
LIBS_FLAG := -l
LIBS_DIRFLAG:= -L
LDFLAGS +=
# Define full .d file generation command since they vary so much. The
# target will be the .d file and the first dependency will be the .c file.
MAKEDEPEND = set -e; $(CC) -H -P -c $(CFLAGS) "$<" -o $*.t 2>&1 | \
grep -v "warning (" | grep -v "error (" | grep -v "ctoa terminated" | \
sort -u | sed 's*^*$*.o $@: *' > $@; \
rm -f $*.t; [ -e $@ ] || rm -f $@
else
ifeq ($(COMPILER), arm)
# Compiler setup - ARM
CC := armcc -cpu $(COMPILER_CPU) -Wa -D_NUCLEUS
INCLUDE_FLAG := -I
C_DEBUGFLAG := -g+ -dwarf2 -DNU_DEBUG
C_OPTFLAG := -O2
CFLAGS +=
OBJ_EXTENTION := .o
AR := armar
ARFLAGS := -create -c -r
LIB_EXTENTION := .a
LINK := armlink
LIBS_FLAG := -l
LIBS_DIRFLAG:= -L
LDFLAGS +=
# Define full .d file generation command since they vary so much. The
# target will be the .d file and the first dependency will be the .c file.
MAKEDEPEND = set -e; $(CC) -M -c $(CFLAGS) $< | \
sort -u | sed 's*^*$*.d $(*D)/*' > $@; \
[ -s $@ ] || rm -f $@
else
# Only DIAB is supported for Nucleus except ARM compiler for ARM target
$(error Compiler '$(COMPILER)' not supported for Nucleus. Only 'diab' and 'arm' are currently supported)
endif
endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -