【问题标题】:make: *** No rule to make target 'all'. Stop. C/C++ Problemmake: *** 没有将目标设为“全部”的规则。停止。 C/C++ 问题
【发布时间】:2020-01-07 08:33:18
【问题描述】:

我正在尝试编译我在 Eclipse CDT 3.8.1 上从 GitHub https://github.com/severinson/VLC-driver 下载的代码并收到此错误:
"make: *** No rule to make target 'x86_64all'"
我已经包含了所有 linux-headers(linux-headers 4.15.0-58 generic)并且我已经搜索了很多这个错误并且每个人都说要对 makefile 进行更改。我找不到 makefile,如何更改 makefile?

    ################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 

# All Target
all: VLC_Driver

# Tool invocations
VLC_Driver: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: GCC C Linker'
    gcc  -o "VLC_Driver" $(OBJS) $(USER_OBJS) $(LIBS)
    @echo 'Finished building target: $@'
    @echo ' '

# Other Targets
clean:
    -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) VLC_Driver
    -@echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

【问题讨论】:

  • 你能给我们看看你的makefile吗?
  • @cocool97,我添加了一个在编译代码时生成的 makefile。如何更改此 makefile?

标签: c linux-kernel embedded-linux beagleboneblack


【解决方案1】:

在您的 Makefile 中,您会看到如下标签:

VLC_Driver: $(OBJS) $(USER_OBJS)

VLC_Driver 这里是一个目标。 标准make命令中的默认目标是all。无论出于何种原因,Eclipse 的目标都是您没有的 x86_64all。要在 Eclipse 中编辑构建目标,请转到 Make Target 视图:

窗口 > 显示视图 > 制作目标

您需要将其设置为all

更多信息here

【讨论】:

  • make 的默认目标不是all,它是Makefile 中的第一个常规目标(不以. 开头),恰好是all案例(以及许多其他 Makefile)。也许 Eclipse 使用不同的约定,增加了潜在的混乱。
  • @chqrlie TIL。我多年来一直在使用 Makefile,但并不知道这一点。那么,我想问题的根源实际上可能是 Makefile 的生成。无论哪种方式,我的答案都应该有效。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-12
  • 1970-01-01
  • 2019-09-27
  • 2016-08-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多