Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 += -IFATFS
  8. INCLUDES += -I../thirdparty/lwip/src/include
  9. INCLUDES += -I../thirdparty/lwip/src/include/netif
  10. INCLUDES += -I../thirdparty/lwip/src/include/lwip
  11. INCLUDES += -I../thirdparty/lwip/src/include/lwip/apps
  12. #INCLUDES += -Ilwip/port/STM32F4x7
  13. #INCLUDES += -Ilwip/port/STM32F4x7/Standalone
  14. #INCLUDES += -Ilwip/port/STM32F4x7/arch
  15. INCLUDES += -I../thirdparty/lwip/port/Standalone
  16. INCLUDES += -I../thirdparty/lwip/system
  17. INCLUDES += -I../thirdparty/lwip/system/arch
  18. INCLUDES += -IModules
  19. INCLUDES += -IModules/Ethernet
  20. INCLUDES += -IModules/Console
  21. INCLUDES += -I../stm32/stm32f4x7_ethernet
  22. INCLUDES += -IUser
  23. INCLUDES += -Istm32sprog
  24. INCLUDES += -I../thirdparty/TinyStdio
  25. INCLUDES += -I../peripheral_modules/inc/
  26. #----
  27. CSRC = $(wildcard *.c ../stm32/system/*.c)
  28. CSRC += $(wildcard ../stm32/stm32f4xx_spl/src/*.c)
  29. #----
  30. CSRC += $(wildcard FATFS/*.c)
  31. CSRC += $(wildcard ../thirdparty/lwip/src/*.c)
  32. CSRC += $(wildcard ../thirdparty/lwip/src/api/*.c)
  33. CSRC += $(wildcard ../thirdparty/lwip/src/core/*.c)
  34. CSRC += $(wildcard ../thirdparty/lwip/src/core/ipv4/*.c)
  35. CSRC += $(wildcard ../thirdparty/lwip/src/netif/*.c)
  36. #CSRC += $(wildcard lwip/port/STM32F4x7/Standalone/*.c)
  37. CSRC += $(wildcard ../thirdparty/lwip/port/Standalone/*.c)
  38. CSRC += $(wildcard Modules/*.c)
  39. CSRC += $(wildcard Modules/Ethernet/httpserver.c)
  40. CSRC += $(wildcard Modules/Ethernet/netconf.c)
  41. CSRC += $(wildcard ../stm32/stm32f4x7_ethernet/*.c)
  42. CSRC += $(wildcard User/*.c)
  43. CSRC += $(wildcard stm32sprog/*.c)
  44. CSRC += $(wildcard ../thirdparty/TinyStdio/*.c)
  45. CSRC += ../peripheral_modules/src/spi_flash.c
  46. #---
  47. CSRC += $(wildcard syscalls/syscalls.c)
  48. CFLAGS = -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -DPRINTF_CUSTOM
  49. CFLAGS += -DHARDWARE_$(shell echo $(HARDWARE) | tr a-z A-Z)
  50. ifeq ($(SWOTRACE), 1)
  51. CFLAGS += -DSWOTRACE
  52. endif
  53. ifeq ($(MAC),)
  54. #Print default MAC
  55. MAC = $(shell awk '/\#define DEVICE_MAC/{print $$3}' ./Modules/settings_api.h )
  56. else
  57. #Set device MAC
  58. CFLAGS += -DDEVICE_MAC='"$(MAC)"'
  59. endif
  60. LDSCRIPT := ../projects/gcc/stm32_flash.ld
  61. ASMSRC = ../projects/gcc/startup_stm32f4xx.s
  62. BUILDDIR = ../build/iap/$(TARGET)
  63. FW_FLASH_START = $(shell awk '/IAP_FLASH_FIRST_PAGE_ADDRESS/{print $$3}' ../config/common_config.h )
  64. FW_FLASH_CRC = $(shell awk '/IAP_FLASH_CRC_ADDRESS/{print $$3}' ../config/common_config.h )
  65. -include ../Makefile.inc.stm32
  66. #Building Web UI FS
  67. WUI_DIR = ../web_interface/dist/upload
  68. FSDATA_DIR = ./Modules/Ethernet
  69. $(FSDATA_DIR)/fsdata.c: $(WUI_DIR)/*
  70. mkdir -p $(FSDATA_DIR)
  71. ../docs/makefsdata.pl $(FSDATA_DIR) $(WUI_DIR)
  72. prebuild: $(FSDATA_DIR)/fsdata.c
  73. @grep -wl --include *.h --include *.c "DEVICE_MAC" ./ -R | xargs touch
  74. @grep -wl --include *.h --include *.c "SWOTRACE" ./ ../shared -R | xargs touch
  75. postbuild:
  76. @echo "Device MAC address: $(MAC)"
  77. @echo "FW start address: $(FW_FLASH_START)"
  78. @echo "FW CRC address: $(FW_FLASH_CRC)"
  79. @$(BUILDDIR)/../../tools/cortex_crc $(OUTPUTDIR)/$(TARGET).bin $(FW_FLASH_START) $(FW_FLASH_CRC)