mac-rom-simm-programmer/hal/at90usb646/at90usb646_options.cmake
Doug Brown 7d0c5e2a09 Implement dummy PC build with stubs
It doesn't actually do anything yet, but it builds and runs. The next
step will be to actually implement "fake" GPIO, USB, and parallel bus.
2021-07-17 14:59:18 -07:00

30 lines
910 B
CMake

# AVR-specific include paths
target_include_directories(SIMMProgrammer.elf PRIVATE
hal/at90usb646
)
# AVR-specific compiler definitions
target_compile_definitions(SIMMProgrammer.elf PRIVATE
F_CPU=16000000UL
F_USB=16000000UL
USE_LUFA_CONFIG_HEADER
)
# AVR-specific compiler options
target_compile_options(SIMMProgrammer.elf PRIVATE
-fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -mmcu=at90usb646
)
# AVR-specific linker options
target_link_options(SIMMProgrammer.elf PRIVATE
-mmcu=at90usb646
)
# AVR-specific command/target to generate .bin file from the ELF file. This program
# is flashed using a bootloader, so there's no need to generate a HEX file.
add_custom_command(OUTPUT SIMMProgrammer.bin
COMMAND ${CMAKE_OBJCOPY} -R .eeprom -O binary SIMMProgrammer.elf SIMMProgrammer.bin
DEPENDS SIMMProgrammer.elf
)
add_custom_target(SIMMProgrammer_bin ALL DEPENDS SIMMProgrammer.bin)