added basic parts of the avr toolchain file
This commit is contained in:
parent
621f7666a6
commit
0288b6eff3
|
@ -0,0 +1,42 @@
|
|||
#Name of the OS
|
||||
set(CMAKE_SYSTEM_NAME )
|
||||
|
||||
set(MCU atmega328p)
|
||||
set(F_CPU 16000000)
|
||||
set(BAUD 9600)
|
||||
add_definitions(-DF_CPU=${F_CPU})
|
||||
|
||||
# program names
|
||||
set(AVRCPP avr-g++)
|
||||
set(AVRC avr-gcc)
|
||||
set(AVRSTRIP avr-strip)
|
||||
set(OBJCOPY avr-objcopy)
|
||||
set(OBJDUMP avr-objdump)
|
||||
set(AVRSIZE avr-size)
|
||||
set(AVRDUDE avrdude)
|
||||
|
||||
# Sets the compiler
|
||||
# Needs to come before the project function
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_CXX_COMPILER ${AVRCPP})
|
||||
set(CMAKE_C_COMPILER ${AVRC})
|
||||
set(CMAKE_ASM_COMPILER ${AVRC})
|
||||
|
||||
project (template_project C CXX ASM)
|
||||
|
||||
# Compiler flags
|
||||
set(CSTANDARD "-std=gnu99")
|
||||
set(CDEBUG "-gstabs -g -ggdb")
|
||||
set(CWARN "-Wall -Wstrict-prototypes -Wl,--gc-sections -Wl,--relax")
|
||||
set(CTUNING "-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections")
|
||||
set(COPT "-Os -lm -lprintf_flt")
|
||||
set(CMCU "-mmcu=${MCU}")
|
||||
set(CDEFS "-DF_CPU=${F_CPU} -DBAUD=${BAUD}")
|
||||
|
||||
set(CFLAGS "${CMCU} ${CDEBUG} ${CDEFS} ${COPT} ${CWARN} ${CSTANDARD} ${CTUNING}")
|
||||
set(CXXFLAGS "${CMCU} ${CDEBUG} ${CDEFS} ${COPT} ${CTUNING}")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CXXFLAGS}")
|
||||
set(CMAKE_ASM_FLAGS "${CFLAGS}")
|
||||
|
Loading…
Reference in New Issue