Advertisement
Guest User

kodmakefile

a guest
Oct 18th, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | Source Code | 0 0
  1. #
  2. # Name: Makefile
  3. #
  4. # Purpose: the make file of this project
  5. #
  6. # Created By: Lipeng<runangaozhong@163.com>
  7. # Created Date: 2013-10-05
  8. #
  9. # ChangeList:
  10. # Created in 2013-10-05 by Lipeng;
  11. #
  12. # This document and the information contained in it is confidential and
  13. # proprietary to Unication Co., Ltd. The reproduction or disclosure, in
  14. # whole or in part, to anyone outside of Unication Co., Ltd. without the
  15. # written approval of the President of Unication Co., Ltd., under a
  16. # Non-Disclosure Agreement, or to any employee of Unication Co., Ltd. who
  17. # has not previously obtained written authorization for access from the
  18. # individual responsible for the document, will have a significant
  19. # detrimental effect on Unication Co., Ltd. and is expressly prohibited.
  20. #
  21. #
  22. include ./config.mk
  23.  
  24. # Sources
  25. SRCS = main.c stm32f4xx_it.c system_stm32f4xx.c syscalls.c mp3.c
  26.  
  27. # Audio
  28. SRCS += Audio.c
  29.  
  30. # sonic
  31. SRCS += sonic.c
  32.  
  33. # fft
  34. SRCS += fft.c
  35.  
  36. # bpm
  37. SRCS += bpm.c
  38.  
  39. # USB
  40. SRCS += usbh_usr.c usb_bsp.c
  41.  
  42.  
  43. CFLAGS += -std=gnu99 -Tstm32_flash.ld
  44.  
  45. ###################################################
  46.  
  47. vpath %.c src
  48. vpath %.a lib
  49.  
  50. ROOT=$(shell pwd)
  51.  
  52. # Includes
  53. CFLAGS += -Iinc -Ilib/Core/cmsis -Ilib/Core/stm32
  54. CFLAGS += -Ilib/Conf
  55.  
  56. # Library paths
  57. LIBPATHS = -Llib/StdPeriph -Llib/USB_OTG
  58. LIBPATHS += -Llib/USB_Host/Core -Llib/USB_Host/Class/MSC
  59. LIBPATHS += -Llib/fat_fs
  60. LIBPATHS += -Llib/helix
  61.  
  62. # Libraries to link
  63. LIBS = -lm -lhelix -lfatfs -lstdperiph -lusbhostcore -lusbhostmsc -lusbcore
  64.  
  65. # Extra includes
  66. CFLAGS += -Ilib/StdPeriph/inc
  67. CFLAGS += -Ilib/USB_OTG/inc
  68. CFLAGS += -Ilib/USB_Host/Core/inc
  69. CFLAGS += -Ilib/USB_Host/Class/MSC/inc
  70. CFLAGS += -Ilib/fat_fs/inc
  71. CFLAGS += -Ilib/helix/pub
  72.  
  73. # add startup file to build
  74. SRCS += lib/startup_stm32f4xx.s
  75.  
  76. OBJS = $(SRCS:.c=.o)
  77.  
  78. ###################################################
  79.  
  80. .PHONY: lib proj
  81.  
  82. all: lib proj
  83. $(SIZE) $(OUTPATH)/$(PROJ_NAME).elf
  84.  
  85. lib:
  86. $(MAKE) -C lib FLOAT_TYPE=$(FLOAT_TYPE)
  87.  
  88. proj: $(OUTPATH)/$(PROJ_NAME).elf
  89.  
  90. $(OUTPATH)/$(PROJ_NAME).elf: $(SRCS)
  91. $(CC) $(CFLAGS) $^ -o $@ $(LIBPATHS) $(LIBS)
  92. $(OBJCOPY) -O ihex $(OUTPATH)/$(PROJ_NAME).elf $(OUTPATH)/$(PROJ_NAME).hex
  93. $(OBJCOPY) -O binary $(OUTPATH)/$(PROJ_NAME).elf $(OUTPATH)/$(PROJ_NAME).bin
  94. $(OBJDUMP) -h -s -D $(OUTPATH)/$(PROJ_NAME).elf > $(OUTPATH)/dump.txt
  95.  
  96. clean:
  97. rm -f *.o
  98. rm -f $(OUTPATH)/$(PROJ_NAME).elf
  99. rm -f $(OUTPATH)/$(PROJ_NAME).hex
  100. rm -f $(OUTPATH)/$(PROJ_NAME).bin
  101. rm -f $(OUTPATH)/dump.txt
  102. $(MAKE) clean -C lib # Remove this line if you don't want to clean the libs as well
  103.  
  104.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement