【发布时间】:2016-08-05 01:18:44
【问题描述】:
我已经阅读了很多关于这个问题的帖子,但我无法解决它。
我在 Linux 上运行,安装了 Eclipse 和 CDT 插件。 我有一个现有的 C 项目,位于 /home/luca/prova。 在这个文件夹中有一些源文件和一个makefile(称为makefile),我在下面报告:
CC = gcc
CFLAGS = -Wall -Werror -O2
HEADERS = lz78_compressor.h lz78_decompressor.h
SOURCES := $(wildcard *.c)
OBJ = $(SOURCES:.c=.o)
EXECUTABLE = lz78
.PHONY : clean install uninstall help
%.o : %.c $(HEADERS)
@$(CC) -c -o $@ $< $(CFLAGS)
$(EXECUTABLE) : $(OBJ)
$(CC) -o $@ $^ $(CFLAGS)
@echo "Build finished. Executable file created : $(EXECUTABLE)"
clean :
rm -f $(EXECUTABLE) $(OBJ)
install :
-@cp ./$(EXECUTABLE) /usr/bin
@echo "Tool installed"
uninstall :
-@rm /usr/bin/$(EXECUTABLE)
@echo "Tool uninstalled"
help :
@echo
@echo "Makefile"
@echo
@echo "make : build all"
@echo "install : install the tool in the system"
@echo "uninstall : remove the tool from the system"
@echo "clean : remove all .o files and the executable file"
@echo
如果我在 shell 中编译,一切正常。但我想在 Eclipse 中导入它。 关注此 wiki,http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fgetting_started%2Fcdt_w_import.htm 我创建了一个新的 C 项目,然后我修改了有关项目构建的设置。 在下一张图片中有我设置的设置:
当我尝试构建项目时,我看到了错误
"make: *** no rule to make target 'all'
为什么?谁能帮帮我?
谢谢
【问题讨论】:
标签: eclipse makefile eclipse-plugin eclipse-cdt