Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # It was quicker to do this than it was to read through the cmake
  2. # documentation to find out how to set "-Os".
  3. # I lie. I just hate CMake. ~oh look at me i'm being a Professional
  4. # Software Engineer on source files all in a single directory for a
  5. # single embedded target~
  6. # --
  7. # Chris Baird,, <chris.j.baird@gmail.com>
  8. all: satdata.h
  9. arm-none-eabi-gcc \
  10. -o build.elf \
  11. -Os -mcpu=cortex-m3 -mthumb -ffunction-sections -nostartfiles -std=gnu99 \
  12. -DSTM32F100C8 -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER \
  13. -lstdc++ -Wl,--gc-sections -T arm-gcc-link.ld \
  14. -I cmsis -I cmsis_boot -I stm_lib/inc -I . \
  15. cmsis_boot/startup/startup_stm32f10x_md_vl.c cmsis_boot/system_stm32f10x.c \
  16. syscalls/syscalls.c \
  17. stm_lib/src/stm32f10x_adc.c stm_lib/src/stm32f10x_flash.c stm_lib/src/stm32f10x_rcc.c \
  18. stm_lib/src/stm32f10x_usart.c stm_lib/src/stm32f10x_tim.c stm_lib/src/stm32f10x_gpio.c \
  19. stm_lib/src/stm32f10x_spi.c stm_lib/src/stm32f10x_dma.c stm_lib/src/misc.c \
  20. init.c util.c delay.c radio.c ublox.c f_rtty.c satpredict.c morse.c main.c \
  21. -l m
  22. arm-none-eabi-objcopy -Obinary build.elf build.bin
  23. arm-none-eabi-size build.elf
  24. ls -l build.bin
  25. flash:
  26. sudo st-flash --reset write build.bin 0x8000000
  27. clean:
  28. rm -f build.elf build.bin predict.tle satdata.h *.o
  29. satdata.h:
  30. bash updatetledata.sh