错误:混合隐式和普通规则

时间:2013-05-01 13:52:52

标签: makefile kernel-module

我刚刚将make更新为

GNU Make 3.82
Built for x86_64-pc-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

并且在此之前这个make文件正常工作

MODULE_NAME = module
$(MODULE_NAME)-objs := Charset.o Connector.o Fpga.o FpgaBus.o FpgaFlash.o I2c.o Key.o Module.o \
                   Oled.o PhoneAudio.o Splash.o AudioCodecIO.o Connection.o Server.o
EXTRA_CFLAGS=-I./include2 -I./include -DALLOW_LOWER_CASE

ifneq ($(KERNELRELEASE),)

obj-m := $(MODULE_NAME).o

else

KDIR := ./build/
PWD := $(shell pwd)

all:
ARCH=arm CROSS_COMPILE=/usr/bin/arm-softfloat-linux-uclibceabi- $(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
ARCH=arm CROSS_COMPILE=/usr/bin/arm-softfloat-linux-uclibceabi- $(MAKE) -C $(KDIR) M=$(PWD) clean

install:
ARCH=arm CROSS_COMPILE=/usr/bin/arm-softfloat-linux-uclibceabi- $(MAKE) -C $(KDIR) M=$(PWD) modules_install

endif

现在它不会出现此错误

ARCH=arm CROSS_COMPILE=/usr/bin/arm-softfloat-linux-uclibceabi- make -C ./build/ M=/home/liam/Dev/driver modules
Makefile:23: *** mixed implicit and normal rules.  Stop.
make[1]: Entering directory `/home/shared/firmware/atmel/kernel'
make: *** [all] Error 2
make[1]: Leaving directory `/home/shared/firmware/atmel/kernel'

知道是什么导致了这个问题吗?

编辑:

好的,我现在有更多信息。自动生成的Makefile从./build/目录中拉入,看起来像这样。

# Automatically generated by /home/shared/firmware/src/linux/scripts/mkmakefile: don't edit

VERSION = 2
PATCHLEVEL = 6

lastword = $(word $(words $(1)),$(1))
makedir := $(dir $(call lastword,$(MAKEFILE_LIST)))

MAKEARGS := -C /home/shared/firmware/src/linux
MAKEARGS += O=$(if $(patsubst /%,,$(makedir)),$(CURDIR)/)$(patsubst %/,%,$(makedir))

MAKEFLAGS += --no-print-directory

.PHONY: all $(MAKECMDGOALS)

all := $(filter-out all Makefile,$(MAKECMDGOALS))

all:
    $(MAKE) $(MAKEARGS) $(all)

Makefile:;

$(all) %/: all
   @:

看着它并查看其他帖子,现在这可能是一个重复的问题。这个版本的make

不应该是最后几行

1 个答案:

答案 0 :(得分:0)

修复正在改变内核构建生成的Makefile

自:

$(all) %/: all
   @:

要:

$(all) : all

other answers可以更好地解释这背后的原因。