Hi all
I develop software for TM4C1994 device using Code ComposerStudio 6.0.1.
Everything is working, project is building etc. But now I need to move to standalone option - makefile build.
So I started to preparing Makefile file for that purpose. I will still use compiler shipped with CCS (armcl)
but all project must build direct from command line. Makefile I wrote is working but I am not sure if everything is OK with it.
And now I have few questions:
1) I use armcl compiler instead of gcc so I need to use files marked as *_ccs* instead of *_gcc*?
2) For normal console build usually two files are needed: startup file and linker script file. In case of
using armcl I should use startup_ccs.c and project_ccs.cmd (bow are from TivaWare C Series examples)?
3) I tried to convert output *.out file to *.bin file needed by LM Flash Programmer the same way as CCS doing it but it generates
around 500MB size bin file instead of 32k.
Bellow is Makefile I created, can someone take a look on it and tell me if I not miss anything? As I mentioned before it is compiling everything
but maybe I miss some important parts, libraries or settings? All flags are the same I use with window version of CCS.
# Project name PROJ_NAME = SerialBuffer # Project directories SRC_DIR = src OBJ_DIR = obj INC_DIRS = inc LIB_DIRS = # Linker script LINKER_SCRIPT = project_ccs.cmd # Environment setup RM_CMD = rm $(OBJ_DIR)/* # Compile process parts CC = armcl CC_FLAGS = CC_LNK_FLAGS = CC_DEFS = CC_LNK_NAMES = # Flags for Tiva C TM4C1294 compiler # For details refer to TI ARM C/C++ Compiler v5.1.6 # Procesor options CC_FLAGS += --silicon_version=7M4 CC_FLAGS += --code_state=16 CC_FLAGS += --float_support=FPv4SPD16 CC_FLAGS += --abi=eabi CC_FLAGS += --little_endian # Debug options CC_FLAGS += --symdebug:dwarf # Optimalization options CC_FLAGS += --opt_level=3 CC_FLAGS += --opt_for_speed=0 # Language options CC_FLAGS += --gcc # Diagnostic options (warnings) CC_FLAGS += --diag_wrap=on CC_FLAGS += --display_error_number CC_FLAGS += --emit_warnings_as_errors # Runtime options CC_FLAGS += --align_structs=4 CC_FLAGS += --enum_type=packed CC_FLAGS += --gen_func_subsections=on CC_FLAGS += --plain_char=signed CC_FLAGS += --small_enum # Assembler options CC_FLAGS += --ual # Directory options CC_FLAGS += --obj_directory=$(OBJ_DIR) # Flags for Tiva C TM4C1295 linker CC_LNK_FLAGS += --run_linker CC_LNK_FLAGS += --heap_size=300 CC_LNK_FLAGS += --stack_size=1000 CC_LNK_FLAGS += --reread_libs # Include directories INC_DIRS += C:/ti/ccsv6/tools/compiler/arm_5.1.6/include INC_DIRS += C:/ti/TivaWare_C_Series-2.1.0.12573 # Add prefix for flags set INC_FLAGS = $(addprefix -I, $(INC_DIRS)) # Project defines CC_DEFS += TARGET_IS_TM4C129_RA0 CC_DEFS += PART_TM4C1294NCPDT CC_DEFS += UART_BUFFERED # Add prefix for flags set DEF_FLAGS = $(addprefix -D, $(CC_DEFS)) # Names for linker CC_LNK_NAMES = rtsv7M4_T_le_eabi.lib driverlib.lib # Add prefix for flags set LNK_NAMES = $(addprefix -l, $(CC_LNK_NAMES)) # Add prefix for flags set LIB_DIRS += C:\ti\TivaWare_C_Series-2.1.0.12573\driverlib\ccs\Debug LIB_DIRS += C:\ti\ccsv6\tools\compiler\arm_5.1.6\lib LIB_FLAGS = $(addprefix -i, $(LIB_DIRS)) # Generate list of needed object files SRCS = $(wildcard $(SRC_DIR)/*.c) $(info SRCS: $(SRCS)) OBJS = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.obj, $(SRCS)) $(info OBJS: $(OBJS)) # Command for compile single target COMPILE_CMD = $(CC) $(CC_FLAGS) $(INC_FLAGS) $(DEF_FLAGS) # Rules for compile all source # $@ - output file # &< - input file $(OBJ_DIR)/%.obj: $(SRC_DIR)/%.c $(COMPILE_CMD) -c $< # Build main binary all: $(OBJS) $(CC) $(CC_LNK_FLAGS) $(LIB_FLAGS) $(LNK_NAMES) $(LINKER_SCRIPT) -m $(PROJ_NAME).map -o $(PROJ_NAME).out $(OBJS) $(OBJ_TO_BIN_CMD) $(PROJ_NAME).out $(PROJ_NAME).bin tiobj2bin.bat "$(PROJ_NAME).out" "$(PROJ_NAME).bin" "armofd" "armhex" "mkhex4bin" # Project cleaning clean: $(RM_CMD)