⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 ATMEL arm7 USB 模拟串口
💻
字号:
# makefile DEMO_FS_MS
# example command line : nmake TARGET=AT91SAM7S256 all
# TARGET = AT91SAM7S64 AT91SAM7S128 AT91SAM7S256 AT91SAM7A3
# USE_LED=1     if present,  USE_LED=0     else
# PULL_UP_USB=1 if present,  PULL_UP_USB=0 else
# NO_TRACE=1    if no trace, NO_TRACE=0    else
# COMPIL=IAR430A for compile with IAR version 4.30A
# COMPIL=IAR420A for compile with IAR version 4.20A

!IF "$(COMPIL)" != "IAR420A" && "$(COMPIL)" != "IAR430A"
!MESSAGE Invalid configuration "$(COMPIL)" specified.
!ERROR An invalid configuration is specified.
!ENDIF 

!IF "$(COMPIL)" == "IAR420A"
COMPILER=C:\Progra~1\IARSYS~1\EMBEDD~1.0KI
VER_IAR=IAR420A
!ENDIF

!IF "$(COMPIL)" == "IAR430A"
COMPILER=C:\Progra~1\IARSYS~1\EMBEDD~1.30K
VER_IAR=IAR430A
!IF "$(TARGET)" == "AT91SAM7A3"
VER_IAR=7SA3_IAR430A
!ENDIF
!ENDIF

# IAR Universal Library Builder V1.03K 
# IAR Universal Library Builder V1.03L
LD=$(COMPILER)\common\bin\xar.exe

# IAR Universal Linker V4.59J/386 
# IAR Universal Linker V4.59N/386
LINK=$(COMPILER)\common\bin\xlink.exe

# IAR ARM ANSI C/C++ Compiler V4.20A/W32 KICKSTART
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART
THUMB_CC=$(COMPILER)\arm\bin\iccarm.exe
ARM_CC=$(COMPILER)\arm\bin\iccarm.exe

# IAR ARM Assembler V4.20A/W32
# IAR ARM Assembler V4.30A/W32
ASS=$(COMPILER)\arm\bin\aarm.exe

# dir /X
INCL1 = -I$(COMPILER)\arm\INC 
INCLIB= $(COMPILER)\arm\LIB
INCL2 = -I..\$(TARGET) 
INCL3 = -Iinc -I ..\COMMON_FS_MS

OBJ = tempo\$(TARGET)

CC=$(THUMB_CC)

# CPU and compile option

!IF $(NO_TRACE)
# ************************
!IF $(USE_LED)
CCFLAGCPU = --cpu_mode thumb -DUSE_LED -DPO_TRACE_LEVEL=0
!IF $(PULL_UP_USB)
CCFLAGCPU = --cpu_mode thumb -DUSE_LED -DPULL_UP_USB -DPO_TRACE_LEVEL=0
!ENDIF
!ELSE
CCFLAGCPU = --cpu_mode thumb -DPO_TRACE_LEVEL=0
!IF $(PULL_UP_USB)
CCFLAGCPU = --cpu_mode thumb -DPULL_UP_USB -DPO_TRACE_LEVEL=0
!ENDIF
!ENDIF
# ************************
!ELSE
# We use the LEVEL of TRACE define in the file po_trace.h
!IF $(USE_LED)
CCFLAGCPU = --cpu_mode thumb -DUSE_LED
!IF $(PULL_UP_USB)
CCFLAGCPU = --cpu_mode thumb -DUSE_LED -DPULL_UP_USB
!ENDIF
!ELSE
CCFLAGCPU = --cpu_mode thumb
!IF $(PULL_UP_USB)
CCFLAGCPU = --cpu_mode thumb -DPULL_UP_USB
!ENDIF
!ENDIF
# ************************
!ENDIF

#CCFLAGCPU = --cpu_mode arm

CCFLAGS2 = --remarks -z9 --endian little --cpu ARM7TDMI --stack_align 4 --interwork -e --fpu None --library_module 
#CCFLAGS3 = --dlib_config \arm\LIB\dl4tptinl8f.h
CCFLAGS3 = --dlib_config $(COMPILER)\arm\LIB\dl4tptinl8f.h

# ************************
# ************************

all: $(TARGET)_lib_common_fs_ms
    @if exist *.axf echo Build completed

rebuild: clean all

clean:
    if exist *.r79 del $(OBJ)\*.r79

$(TARGET)_lib_common_fs_ms: at91stdio bfsa_flash po_Kernel dbgu Flash po_kernel
    $(LD) $(OBJ)\Flash.r79 $(OBJ)\at91stdio.r79 $(OBJ)\bfsa_flash.r79 $(OBJ)\dbgu.r79 $(OBJ)\po_Kernel.r79 -o $(OBJ)\$(TARGET)_lib_common_fs_ms.r79

bfsa_flash: bfsa_flash.c
# board.h po_types.h po_trace.h po_kernel.h flash.h bfsa_flash.h
    $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) bfsa_flash.c

dbgu: dbgu.c
# Board.h dbgu.h
    $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) dbgu.c

po_kernel: po_Kernel.c
# po_trace.h po_types.h po_kernel.h
    $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) po_Kernel.c

flash: Flash.c
# Board.h Flash.h po_trace.h po_types.h po_kernel.h dbgu.h
    $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) Flash.c

at91stdio: at91stdio.c
# at91stdio.h
    $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) at91stdio.c

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -