Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. TARGET = iap
  2. INCLUDES = -I../stm32/stm32f4xx_spl/inc
  3. INCLUDES += -I../stm32/system
  4. INCLUDES += -I../config
  5. #----
  6. INCLUDES += -I.
  7. INCLUDES += -I../thirdparty/lwip/src/include
  8. INCLUDES += -I../thirdparty/lwip/src/include/netif
  9. INCLUDES += -I../thirdparty/lwip/src/include/lwip
  10. INCLUDES += -I../thirdparty/lwip/src/include/ipv4
  11. INCLUDES += -Ilwip/port/STM32F4x7
  12. INCLUDES += -Ilwip/port/STM32F4x7/Standalone
  13. INCLUDES += -Ilwip/port/STM32F4x7/arch
  14. INCLUDES += -IModules
  15. INCLUDES += -IModules/Ethernet
  16. INCLUDES += -IModules/Console
  17. INCLUDES += -I../stm32/stm32f4x7_ethernet
  18. INCLUDES += -IUser
  19. INCLUDES += -I../thirdparty/TinyStdio
  20. #----
  21. CSRC = $(wildcard *.c ../stm32/system/*.c)
  22. CSRC += $(wildcard ../stm32/stm32f4xx_spl/src/*.c)
  23. #----
  24. CSRC += $(wildcard ../thirdparty/lwip/src/*.c)
  25. CSRC += $(wildcard ../thirdparty/lwip/src/api/*.c)
  26. CSRC += $(wildcard ../thirdparty/lwip/src/core/*.c)
  27. CSRC += $(wildcard ../thirdparty/lwip/src/core/ipv4/*.c)
  28. CSRC += $(wildcard ../thirdparty/lwip/src/netif/*.c)
  29. CSRC += $(wildcard lwip/port/STM32F4x7/Standalone/*.c)
  30. CSRC += $(wildcard Modules/*.c)
  31. CSRC += $(wildcard Modules/Ethernet/httpserver.c)
  32. CSRC += $(wildcard Modules/Ethernet/netconf.c)
  33. CSRC += $(wildcard ../stm32/stm32f4x7_ethernet/*.c)
  34. CSRC += $(wildcard User/*.c)
  35. CSRC += $(wildcard ../thirdparty/TinyStdio/*.c)
  36. #---
  37. CSRC += $(wildcard syscalls/syscalls.c)
  38. CFLAGS = -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -DPRINTF_CUSTOM
  39. CFLAGS += -DHARDWARE_$(shell echo $(HARDWARE) | tr a-z A-Z)
  40. ifeq ($(SWOTRACE), 1)
  41. CFLAGS += -DSWOTRACE
  42. endif
  43. ifeq ($(MAC),)
  44. #Print default MAC
  45. MAC = $(shell awk '/\#define DEVICE_MAC/{print $$3}' ./Modules/settings_api.h )
  46. else
  47. #Set device MAC
  48. CFLAGS += -DDEVICE_MAC='"$(MAC)"'
  49. endif
  50. LDSCRIPT := ../projects/gcc/stm32_flash.ld
  51. ASMSRC = ../projects/gcc/startup_stm32f4xx.s
  52. BUILDDIR = ../build/iap/$(TARGET)
  53. FW_FLASH_START = $(shell awk '/IAP_FLASH_FIRST_PAGE_ADDRESS/{print $$3}' ../config/common_config.h )
  54. FW_FLASH_CRC = $(shell awk '/IAP_FLASH_CRC_ADDRESS/{print $$3}' ../config/common_config.h )
  55. -include ../Makefile.inc.stm32
  56. prebuild:
  57. @grep -wl --include *.h --include *.c "DEVICE_MAC" ./ -R | xargs touch
  58. @grep -wl --include *.h --include *.c "SWOTRACE" ./ ../shared -R | xargs touch
  59. postbuild:
  60. @echo "Device MAC address: $(MAC)"
  61. @echo "FW start address: $(FW_FLASH_START)"
  62. @echo "FW CRC address: $(FW_FLASH_CRC)"
  63. @$(BUILDDIR)/../../tools/cortex_crc $(OUTPUTDIR)/$(TARGET).bin $(FW_FLASH_START) $(FW_FLASH_CRC)