📄 makefile
字号:
# 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_mass
@if exist *.axf echo Build completed
rebuild: clean all
clean:
if exist *.r79 del *.r79
$(TARGET)_lib_mass: fw_chap9 fw_cmd fw_epmg fw_gpub fw_task ms_api ms_bot ms_rbc
$(LD) $(OBJ)\fw_chap9.r79 $(OBJ)\fw_cmd.r79 $(OBJ)\fw_epmg.r79 $(OBJ)\fw_gpub.r79 $(OBJ)\fw_task.r79 $(OBJ)\ms_api.r79 $(OBJ)\ms_bot.r79 $(OBJ)\ms_rbc.r79 -o $(OBJ)\$(TARGET)_lib_mass.r79
#Cstartup_SAM7: Cstartup_SAM7.c
#Board.h
# $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) Cstartup_SAM7.c
fw_chap9: fw_chap9.c
#po_types.h po_trace.h fw_usb.h po_kernel.h ms_device.h ms_rbc.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) fw_chap9.c
fw_cmd: fw_cmd.c
#po_types.h po_trace.h fw_usb.h po_kernel.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) fw_cmd.c
fw_epmg: fw_epmg.c
#po_types.h po_trace.h fw_usb.h po_kernel.h ms_device.h ms_rbc.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) fw_epmg.c
fw_gpub: fw_gpub.c
#po_types.h po_trace.h po_kernel.h fw_usb.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) fw_gpub.c
fw_task: fw_task.c
#board.h po_types.h po_trace.h fw_usb.h po_kernel.h ms_device.h ms_rbc.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) fw_task.c
ms_api: ms_api.c
#ms_device.h po_types.h po_trace.h fw_usb.h po_kernel.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) ms_api.c
ms_bot: ms_bot.c
#po_types.h po_trace.h bfsa_flash.h fw_usb.h po_kernel.h ms_device.h ms_rbc.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) ms_bot.c
ms_rbc: ms_rbc.c
#po_types.h po_trace.h bfsa_flash.h fw_usb.h po_kernel.h ms_device.h ms_rbc.h
$(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) ms_rbc.c
#main: main.c
#dbgu.h po_types.h po_kernel.h po_trace.h bfsa_flash.h bfsa_api.h fw_usb.h
# $(CC) $(INCL1) $(INCL2) $(INCL3) -D$(TARGET) $(CCFLAGCPU) $(CCFLAGS2) $(CCFLAGS3) -o $(OBJ) main.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -