当前位置: 技术问答>linux和unix
windows下使用GNUWIN32的Make操作时出错
来源: 互联网 发布时间:2017-01-26
本文导语: windows下使用GNUWIN32的Make操作时出错,GNUWIN32安装位置C:Documents and SettingsAdministrator桌面SAMBA相关GNUWIN32GetGnuWin32gnuwin32bin,AT91SAM的安装路径为C:Program FilesATMEL CorporationAT91-ISP v1.12SAM-BA v2.8appletsisp-appletsextram,CodeSourcery...
windows下使用GNUWIN32的Make操作时出错,GNUWIN32安装位置C:Documents and SettingsAdministrator桌面SAMBA相关GNUWIN32GetGnuWin32gnuwin32bin,AT91SAM的安装路径为C:Program FilesATMEL CorporationAT91-ISP v1.12SAM-BA v2.8appletsisp-appletsextram,CodeSourcery安装位置C:Program FilesCodeSourcerySourcery_CodeBench_for_ARM_EABI,在该目录下有arm-none-eabi文件件,该下面有个BIN文件夹,下面有gcc.exe;该目录下还有一个BIN文件,里面有arm-none-eabi-gcc.exe,我在配置编译器的时候,这两个编译器均进行了尝试,错误都一样,如下:
C:Documents and SettingsAdministrator桌面SAMBA相关GNUWIN32GetGnuWin32gnuw
in32bin>make -C "C:Program FilesATMEL CorporationAT91-ISP v1.12SAM-BA v2.8
appletsisp-appletsextram" CHIP=at91sam9260 BOARD=at91sam9260-ek MEMORY=sram_sa
mba DYN_TRACES=1 clean all
make: Entering directory `C:/Program Files/ATMEL Corporation/AT91-ISP v1.12/SAM-
BA v2.8/applets/isp-applets/extram'
rm -f obj/*.o bin/*.bin bin/*.elf
rm: 无法删除‘obj/*.o’: Invalid argument
rm: 无法删除‘bin/*.bin’: Invalid argument
rm: 无法删除‘bin/*.elf’: Invalid argument
make: [clean] 错误 1 (忽略)
../../../../../../CodeSourcery/Sourcery_CodeBench_for_ARM_EABI/bin arm-none-eabi
-gcc -g -Os -I../../at91lib/boards/at91sam9260-ek -I../../at91lib/peripherals -
I../../at91lib/components -I../../at91lib -Dat91sam9260 -D__ASSEMBLY__ -c -o obj
/isp_cstartup.o ../common/isp_cstartup.S
process_begin: CreateProcess(NULL, ../../../../../../CodeSourcery/Sourcery_CodeB
ench_for_ARM_EABI/bin arm-none-eabi-gcc -g -Os -I../../at91lib/boards/at91sam926
0-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat
91sam9260 -D__ASSEMBLY__ -c -o obj/isp_cstartup.o ../common/isp_cstartup.S, ...)
failed.
make (e=2): 系统找不到指定的文件。
make: *** [obj/isp_cstartup.o] 错误 2
make: Leaving directory `C:/Program Files/ATMEL Corporation/AT91-ISP v1.12/SAM-B
A v2.8/applets/isp-applets/extram'
以下为makefile文件:
# ----------------------------------------------------------------------------
# ATMEL Microcontroller Software Support - ROUSSET -
# ----------------------------------------------------------------------------
# Copyright (c) 2007, Atmel Corporation
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer below in the documentation and/or
# other materials provided with the distribution.
#
# Atmel's name may not be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ----------------------------------------------------------------------------
# Makefile for compiling isp-project extram applet
#-------------------------------------------------------------------------------
# User-modifiable options
#-------------------------------------------------------------------------------
# Chip & board used for compilation
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
CHIP = at91sam9260
BOARD = at91sam9260-ek
# Optimization level, put in comment for debugging
OPTIMIZATION = -Os
# For chip with few memory, set DYN_TRACES to 0
ifeq ($(DYN_TRACES),1)
DYNAMIC_TRACE_LEVEL = -DDYNAMIC_TRACE_LEVEL
else
DYNAMIC_TRACE_LEVEL = -DNOTRACE
endif
# install directory
ifeq ($(CHIP),at91cap9)
BOARD_DIR = $(BOARD)
else
BOARD_DIR = $(CHIP)-ek
endif
ifdef INST_PREFIX
INSTALLDIR = "$(INST_PREFIX)/$(BOARD_DIR)/"
else
INSTALLDIR = "../lib/$(BOARD_DIR)/"
endif
# AT91 library directory
AT91LIB = ../../at91lib
# Output file basename
OUTPUT = isp-extram-$(CHIP)
# Output directories
BIN = bin
OBJ = obj
#-------------------------------------------------------------------------------
# Tools
#-------------------------------------------------------------------------------
# Tool suffix when cross-compiling
CROSS = ../../../../../../CodeSourcery/Sourcery_CodeBench_for_ARM_EABI/bin
# Compilation tools
CC = $(CROSS)arm-none-eabi-gcc
SIZE = $(CROSS)arm-none-eabi-size
STRIP = $(CROSS)arm-none-eabi-strip
OBJCOPY = $(CROSS)arm-none-eabi-objcopy
# Flags
INCLUDES = -I$(AT91LIB)/boards/$(BOARD) -I$(AT91LIB)/peripherals
INCLUDES += -I$(AT91LIB)/components -I$(AT91LIB)
CFLAGS = -Wall -mlong-calls -ffunction-sections
CFLAGS += -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) $(DYNAMIC_TRACE_LEVEL)
ASFLAGS = -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS = -g $(OPTIMIZATION) -nostartfiles -Wl,--gc-sections
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
# Directories where source files can be found
ISP = ..
PERIPH = $(AT91LIB)/peripherals
COMP = $(AT91LIB)/components
BOARDS = $(AT91LIB)/boards
UTILITY = $(AT91LIB)/utility
VPATH += $(ISP)/common
VPATH += $(UTILITY)
VPATH += $(PERIPH)/dbgu $(PERIPH)/pio $(PERIPH)/aic
VPATH += $(BOARDS)/$(BOARD) $(BOARDS)/$(BOARD)/$(CHIP)
# Objects built from C source files
C_OBJECTS = main.o
C_OBJECTS += board_memories.o board_lowlevel.o
C_OBJECTS += dbgu.o
C_OBJECTS += pio.o
C_OBJECTS += div0.o stdio.o
# Objects built from Assembly source files
ASM_OBJECTS = isp_cstartup.o
# Append OBJ and BIN directories to filenames
C_OBJECTS := $(addprefix $(OBJ)/, $(C_OBJECTS))
ASM_OBJECTS := $(addprefix $(OBJ)/, $(ASM_OBJECTS))
OUTPUT := $(BIN)/$(OUTPUT)
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
all: $(BIN) $(OBJ) $(MEMORY) install
$(BIN) $(OBJ):
@mkdir $@
$(MEMORY): $(ASM_OBJECTS) $(C_OBJECTS)
$(CC) $(LDFLAGS) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$@.lds" -o $(OUTPUT).elf $^
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
$(SIZE) $(ASM_OBJECTS) $(C_OBJECTS) $(OUTPUT).elf
$(C_OBJECTS): $(OBJ)/%.o: %.c Makefile
$(CC) $(CFLAGS) -c -o $@ $
C:Documents and SettingsAdministrator桌面SAMBA相关GNUWIN32GetGnuWin32gnuw
in32bin>make -C "C:Program FilesATMEL CorporationAT91-ISP v1.12SAM-BA v2.8
appletsisp-appletsextram" CHIP=at91sam9260 BOARD=at91sam9260-ek MEMORY=sram_sa
mba DYN_TRACES=1 clean all
make: Entering directory `C:/Program Files/ATMEL Corporation/AT91-ISP v1.12/SAM-
BA v2.8/applets/isp-applets/extram'
rm -f obj/*.o bin/*.bin bin/*.elf
rm: 无法删除‘obj/*.o’: Invalid argument
rm: 无法删除‘bin/*.bin’: Invalid argument
rm: 无法删除‘bin/*.elf’: Invalid argument
make: [clean] 错误 1 (忽略)
../../../../../../CodeSourcery/Sourcery_CodeBench_for_ARM_EABI/bin arm-none-eabi
-gcc -g -Os -I../../at91lib/boards/at91sam9260-ek -I../../at91lib/peripherals -
I../../at91lib/components -I../../at91lib -Dat91sam9260 -D__ASSEMBLY__ -c -o obj
/isp_cstartup.o ../common/isp_cstartup.S
process_begin: CreateProcess(NULL, ../../../../../../CodeSourcery/Sourcery_CodeB
ench_for_ARM_EABI/bin arm-none-eabi-gcc -g -Os -I../../at91lib/boards/at91sam926
0-ek -I../../at91lib/peripherals -I../../at91lib/components -I../../at91lib -Dat
91sam9260 -D__ASSEMBLY__ -c -o obj/isp_cstartup.o ../common/isp_cstartup.S, ...)
failed.
make (e=2): 系统找不到指定的文件。
make: *** [obj/isp_cstartup.o] 错误 2
make: Leaving directory `C:/Program Files/ATMEL Corporation/AT91-ISP v1.12/SAM-B
A v2.8/applets/isp-applets/extram'
以下为makefile文件:
# ----------------------------------------------------------------------------
# ATMEL Microcontroller Software Support - ROUSSET -
# ----------------------------------------------------------------------------
# Copyright (c) 2007, Atmel Corporation
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer below in the documentation and/or
# other materials provided with the distribution.
#
# Atmel's name may not be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ----------------------------------------------------------------------------
# Makefile for compiling isp-project extram applet
#-------------------------------------------------------------------------------
# User-modifiable options
#-------------------------------------------------------------------------------
# Chip & board used for compilation
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
CHIP = at91sam9260
BOARD = at91sam9260-ek
# Optimization level, put in comment for debugging
OPTIMIZATION = -Os
# For chip with few memory, set DYN_TRACES to 0
ifeq ($(DYN_TRACES),1)
DYNAMIC_TRACE_LEVEL = -DDYNAMIC_TRACE_LEVEL
else
DYNAMIC_TRACE_LEVEL = -DNOTRACE
endif
# install directory
ifeq ($(CHIP),at91cap9)
BOARD_DIR = $(BOARD)
else
BOARD_DIR = $(CHIP)-ek
endif
ifdef INST_PREFIX
INSTALLDIR = "$(INST_PREFIX)/$(BOARD_DIR)/"
else
INSTALLDIR = "../lib/$(BOARD_DIR)/"
endif
# AT91 library directory
AT91LIB = ../../at91lib
# Output file basename
OUTPUT = isp-extram-$(CHIP)
# Output directories
BIN = bin
OBJ = obj
#-------------------------------------------------------------------------------
# Tools
#-------------------------------------------------------------------------------
# Tool suffix when cross-compiling
CROSS = ../../../../../../CodeSourcery/Sourcery_CodeBench_for_ARM_EABI/bin
# Compilation tools
CC = $(CROSS)arm-none-eabi-gcc
SIZE = $(CROSS)arm-none-eabi-size
STRIP = $(CROSS)arm-none-eabi-strip
OBJCOPY = $(CROSS)arm-none-eabi-objcopy
# Flags
INCLUDES = -I$(AT91LIB)/boards/$(BOARD) -I$(AT91LIB)/peripherals
INCLUDES += -I$(AT91LIB)/components -I$(AT91LIB)
CFLAGS = -Wall -mlong-calls -ffunction-sections
CFLAGS += -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) $(DYNAMIC_TRACE_LEVEL)
ASFLAGS = -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS = -g $(OPTIMIZATION) -nostartfiles -Wl,--gc-sections
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
# Directories where source files can be found
ISP = ..
PERIPH = $(AT91LIB)/peripherals
COMP = $(AT91LIB)/components
BOARDS = $(AT91LIB)/boards
UTILITY = $(AT91LIB)/utility
VPATH += $(ISP)/common
VPATH += $(UTILITY)
VPATH += $(PERIPH)/dbgu $(PERIPH)/pio $(PERIPH)/aic
VPATH += $(BOARDS)/$(BOARD) $(BOARDS)/$(BOARD)/$(CHIP)
# Objects built from C source files
C_OBJECTS = main.o
C_OBJECTS += board_memories.o board_lowlevel.o
C_OBJECTS += dbgu.o
C_OBJECTS += pio.o
C_OBJECTS += div0.o stdio.o
# Objects built from Assembly source files
ASM_OBJECTS = isp_cstartup.o
# Append OBJ and BIN directories to filenames
C_OBJECTS := $(addprefix $(OBJ)/, $(C_OBJECTS))
ASM_OBJECTS := $(addprefix $(OBJ)/, $(ASM_OBJECTS))
OUTPUT := $(BIN)/$(OUTPUT)
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
all: $(BIN) $(OBJ) $(MEMORY) install
$(BIN) $(OBJ):
@mkdir $@
$(MEMORY): $(ASM_OBJECTS) $(C_OBJECTS)
$(CC) $(LDFLAGS) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$@.lds" -o $(OUTPUT).elf $^
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
$(SIZE) $(ASM_OBJECTS) $(C_OBJECTS) $(OUTPUT).elf
$(C_OBJECTS): $(OBJ)/%.o: %.c Makefile
$(CC) $(CFLAGS) -c -o $@ $