2017-04-20 172 views
0

我一直在使用makefile,我需要帮助。我正在windows中运行一个虚拟的linux窗口。我无法让makefile工作

从包含我的main.c文件的文件夹,我键入make,我得到

$make 
arm-linux-gnueabihf-gcc -g -Wall -I c:\intelFPGA\16.1\embedded\ip\altera\hps\altera_hps\hwlib\include _c main.c -o main.o 
process_begin: CreateProcess(NULL, arm-linux-gnueabihf-gcc -g -Wall -I c:\intelFPGA\16.1\embedded\ip\altera\hps\altera_hps\hwlib\include _c main.c -o main.o, ...)failed. 
make(e=2): The system cannot find the file specified. 
make: *** [main.o] Error 2 

该文件夹包含以下文件和一个空文件夹。 main.c Makefile my_first_hps

如果我输入“where make”,我会得到。

$where make 
c:\intelFPGA_lite\16.1\nios2eds\bin\gnu\H-x86_64-mingw32\bin\make.exe 
c:\intelFPGA\16.1\quartus\bin64\cygwin\bin\make.exe 
c:\Coreutils\bin\make.exe 

我的Makefile是。

# 
TARGET = my_first_hps 

# 
CROSS_COMPILE = arm-linux-gnueabihf- 
CFLAGS = -g -Wall -I ${SOCEDS_DEST_ROOT}c:/intelFPGA/embedded/ip/altera/hps/altera_hps/hwlib/include 
LDFLAGS = -g -Wall 
CC = $(CROSS_COMPILE)gcc 
ARCH= arm 

build: $(TARGET) 

$(TARGET): main.o 
    $(CC) $(LDFLAGS) $^ -o [email protected] 

%.o : %.c 
    $(CC) $(CFLAGS) -c $< -o [email protected] 

.PHONY: clean 
clean: 
    rm -f $(TARGET) *.a *.o *~ 
+1

在我看来就像它的GCC无法找到,不会让。 –

+0

在“c:\ intelFPGA \ ..... \ include”中有需要的头文件。这里有一个gcc.exe“\ intelFPGA_lite \ 16.1 \ quartus \ bin64 \ cygwin \ bin \ gcc.exe”。你会建议什么? – Doug

+0

看看你是否可以从命令行运行gcc,使用与make相同的命令('arm-linux-gnueabihf-gcc')。它从那里工作(从gcc产生输出),还是你得到相同的错误? –

回答

0

我知道这是一个有点晚,但对于那些谁得到了同样的错误,我只是改变了以下行:

CC = $(CROSS_COMPILE)gcc 

CC = $(CROSS_COMPILE)gcc.exe 

已为我工作。另外不要忘记你应该安装Altera EDS和DS-5。我在同一个地方安装DS-5与EDS:

ds-5 installation location image