1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
CC = arm-none-eabi-gcc LD = arm-none-eabi-gcc AR = arm-none-eabi-ar AS = arm-none-eabi-as CP = arm-none-eabi-objcopy OD = arm-none-eabi-objdump DRIVER = STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver CMSIS = STM32_USB-FS-Device_Lib_V4.0.0/Libraries/CMSIS CMSISD = STM32_USB-FS-Device_Lib_V4.0.0/Libraries/CMSIS/Device/ST/STM32F10x libdir = lib CFLAGS = -I. -I$(DRIVER)/inc -I$(CMSIS)/Include -I$(CMSISD)/Include -DSTM32F10X_XL -DUSE_STDPERIPH_DRIVER -c -fno-common -O0 -g -march=armv7-m -mcpu=cortex-m3 -mthumb -mthumb-interwork --std=gnu99 AFLAGS = -mapcs-32 LFLAGS = -nostartfiles CPFLAGS = -Obinary ODFLAGS = -S libs = $(libdir)/libstdperiphdriver.a $(libdir)/libcmsisd.a all: libs main .PHONY : libs libs: $(libs) clean: -rm -f main.lst main.bin main.elf main.hex main.map *.o $(libdir)/* ################# # libraries ################# $(libdir)/libstdperiphdriver.a: stm32f10x_rcc.o stm32f10x_gpio.o stm32f10x_usart.o stm32f10x_exti.o stm32f10x_dac.o stm32f10x_tim.o stm32f10x_dma.o stm32f10x_pwr.o $(AR) rvs $@ $^ stm32f10x_rcc.o: $(DRIVER)/src/stm32f10x_rcc.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_gpio.o: $(DRIVER)/src/stm32f10x_gpio.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_usart.o: $(DRIVER)/src/stm32f10x_usart.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_exti.o: $(DRIVER)/src/stm32f10x_exti.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_dac.o: $(DRIVER)/src/stm32f10x_dac.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_tim.o: $(DRIVER)/src/stm32f10x_tim.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_dma.o: $(DRIVER)/src/stm32f10x_dma.c @ echo $(CC) $(CFLAGS) $^ stm32f10x_pwr.o: $(DRIVER)/src/stm32f10x_pwr.c @ echo $(CC) $(CFLAGS) $^ $(libdir)/libcmsisd.a: system_stm32f10x.o $(AR) rvs $@ $^ system_stm32f10x.o: $(CMSISD)/Source/Templates/system_stm32f10x.c @ echo $(CC) $(CFLAGS) $^ main: main.elf @ echo "...copying" $(CP) $(CPFLAGS) main.elf main.bin $(OD) $(ODFLAGS) main.elf > main.lst main.elf: stm32.ld main.o crt0.o crt1.o irq.o svc.o $(libs) @ echo $(LD) $(LFLAGS) -T$^ speex/lib/libspeex.a -o$@ crt0.o: crt0.c @ echo $(CC) $(CFLAGS) $^ crt1.o: crt1.c @ echo $(CC) $(CFLAGS) $^ irq.o: irq.c @ echo $(CC) $(CFLAGS) $^ svc.o: svc.s @ echo $(AS) $(AFLAGS) $^ -o$@ main.o: main.c @ echo $(CC) $(CFLAGS) $^ samples.bin: samples/samples.raw dd if=$^ of=$@ bs=1 count=512K samples/samples.raw: samples/samples.wav sox -v.9 $^ -c1 -r8k -b8 -eunsigned-integer $@ tags: Makefile ctags-exuberant --c-kinds=+p --c++-kinds=+p --fields=+iaS --extra=+q * \ $(DRIVER)/src/* $(DRIVER)/inc/* \ $(CMSIS)/Include/* \ $(CMSISD)/Include/* \ speex/* \ ~/usr/arm-none-eabi/include/* |