【发布时间】:2017-11-17 20:43:50
【问题描述】:
我有一个在这个版本的 Linux 上运行良好的 make 文件。然而 为什么它不在这个其他版本上运行......
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
codename : trusty
就在这里...它不能在这个上运行?为什么?
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
我在 xenial 上收到此错误...为什么?
Ubuntu mate $:make
gcc: error: missing filename after ‘-o’
gcc: fatal error: no input files
compilation terminated.
这是我的make文件(更新了,上一篇没有这个)
CFLAGS = gcc -g
OBJ = dummyDriverX1.o x1.o error.o
# Automatic substitution using suffix rules to
%.o: %.c
${CFLAGS} -c $<
%.o: %.cpp
${CFLAGS} -c $<
# Building x1 based on the required .o files
pell: ${OBJ}
${CFLAGS} -o pell ${OBJ}
clean:
rm ${OBJ}
【问题讨论】:
-
显示生成文件。
-
Linux版本无关,重要的是
make的版本。 -
makefile 可能依赖于其他有问题的脚本。
-
不确定这是否有任何价值,但是当我调用 make -v (以便我可以看到版本,根据手册页)我得到一个 gcc: fatal error: no input files编译终止。
-
你的
Makefile真的错了。请参阅this 示例;删除您的Makefile,运行make -p以了解内置规则,并正确编写您的新Makefile。
标签: linux ubuntu makefile ubuntu-14.04 ubuntu-16.04