2017-04-20 173 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