12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- GCC_ARM_PATH := E:\gcc-arm-none-eabi-5_4-2016q3-20160926-win32
- THUMB_PATH := $(GCC_ARM_PATH)\arm-none-eabi\lib\thumb
- CROSS_COMPILE := $(GCC_ARM_PATH)\bin\arm-none-eabi-
- BT_PATH= ..\..\..\..\..\respin_1208
- PATCH_PATH = $(BT_PATH)\output
- UTIL_PATH = $(BT_PATH)\util
- OUT_PATH = .\output
- INC = .\$(GCC_ARM_PATH)\arm-none-eabi\include
- SDK_ROOT = ..\..\..\..\Librarier
- SRC_ROOT = ..\..\User
- INCLUDES = -I$(SDK_ROOT)/cmsis/ \
- -I$(SDK_ROOT)/device/ \
- -I$(SDK_ROOT)/drivers/hal/ \
- -I$(SDK_ROOT)/drivers/uart/ \
- -I$(SDK_ROOT)/drivers/gpio/ \
- -I$(SDK_ROOT)/drivers/it/ \
- -I$(SDK_ROOT)/drivers/timer/ \
- -I$(SDK_ROOT)/drivers/bt/ \
- -I$(SDK_ROOT)/patch/ \
- SRC_FILES = $(SRC_ROOT)/main.c \
- $(SDK_ROOT)/drivers/uart/yc11xx_uart.c \
- $(SDK_ROOT)/drivers/hal/yc_drv_common.c \
- $(SDK_ROOT)/libcore/sys/system.c \
- $(SDK_ROOT)/drivers/gpio/yc11xx_gpio.c \
- $(SDK_ROOT)/drivers/it/yc_it.c \
- $(SDK_ROOT)/drivers/timer/yc_timer.c \
- $(SDK_ROOT)/drivers/bt/yc11xx_bt.c \
- $(SDK_ROOT)/libcore/sys/systick.c
- OBJ = ${patsubst %.c, %.o, ${SRC_FILES}}
- LDSCRIPTS := -T gcc.ld -lgcc
- LIBFILES := -lm -I${INC} -l yc11xx -lc
- LIBDIR := -L.
- LIBDIR += -L "$(GCC_ARM_PATH)\lib\gcc\arm-none-eabi\5.4.1\armv6-m"
- LIBDIR += -L "$(GCC_ARM_PATH)\arm-none-eabi\lib\armv6-m"
- LIBDIR += -L "$(SDK_ROOT)\libcore"
- #$(warning OBJIEAT is $(OBJ))
- all : output\a.out
- $(CROSS_COMPILE)objdump -S $^ > output\disasm
- $(CROSS_COMPILE)objcopy $^ -O ihex output\out.hex
-
- perl .\tool\hex2rom.pl 0 80000 < output\out.hex > output\out.rom
- copy $(PATCH_PATH)\ramcode.rom .\output\ramcode.rom
- copy $(PATCH_PATH)\sched.rom .\output\sched.rom
- copy $(PATCH_PATH)\memmap.format .\output\memmap.format
- OBJS = startup_m0.o
- output\a.out : $(OBJ) $(OBJS)
- $(CROSS_COMPILE)ld $^ -o $@ $(LIBDIR) $(LIBFILES) $(LDSCRIPTS) -Map=./output\memmap
- $(OBJS) : ./startup/startup_m0.s
- $(CROSS_COMPILE)as $^ -o $@ -mthumb -mcpu=cortex-m0
- $(OBJ) : %.o : %.c
- $(CROSS_COMPILE)gcc $^ -c $(INCLUDES) -g -O0 -o $@ -mthumb -mcpu=cortex-m0 -msoft-float -fno-toplevel-reorder
- clean :
- del /Q output\*.*
- del /Q /S .\*.o
- del /Q /S ..\..\*.o
|