make with -R查找fileName..asm而不是fileName.asm

时间:2013-11-25 01:42:44

标签: makefile gnu-make

寻找文件(点点).asm

我使用-R开关来避免被-d行淹没。我有文件findKey.s。使用具有等效makefile语句的cpp扩展名没有问题。

我认为是相关的makefile行:

CC = "f:\IAR Systems\Embedded Workbench 6.5\arm\bin\iccarm"
ASM = "f:\IAR Systems\Embedded Workbench 6.5\arm\bin\iasmarm"

all : findKey.o intVec.o invBea.o

%.o: %.cpp
    $(CC) "$<" -lC "$(listDir)" -o "$(objDir)" $(dlib) $(C_allOptions) --eec++

%.o: %.c
    $(CC) "$<" -lC "$(listDir)" -o "$(objDir)" $(dlib) $(C_allOptions)

%o: %.asm
    $(ASM) "$<" -O"$(objDir)" -L"$(listDir)" -r -cM t8 --cpu Cortex-M4 --fpu None

%o: %.s
    $(ASM) "$<" -O"$(objDir)" -L"$(listDir)" -r -cM t8 --cpu Cortex-M4 --fpu None

[BEGIN调试输出]

GNU Make 3.82
Built for x86_64-w64-mingw32
This program is built by Equation Solution <http://www.Equation.com>
for Windows.
Copyright (C) 2010  Free Software Foundation, Inc.
[snip]
Updating goal targets....
Considering target file `all'.
 File `all' does not exist.
  Considering target file `findKey.o'.
   File `findKey.o' does not exist.
   Looking for an implicit rule for `findKey.o'.
   Trying pattern rule with stem `findKey'.
   Trying implicit prerequisite `findKey.cpp'.
   Trying pattern rule with stem `findKey'.
   Trying implicit prerequisite `findKey.c'.
   Trying pattern rule with stem `findKey.'.
   Trying implicit prerequisite `findKey..asm'.  <== WHY THIS??
   Trying pattern rule with stem `findKey.'.
   Trying implicit prerequisite `findKey..s'.  <== AND THIS??
   Trying pattern rule with stem `findKey'.
   Trying implicit prerequisite `findKey.cpp'.
   Looking for a rule with intermediate file `findKey.cpp'.
    Avoiding implicit rule recursion.
   Trying pattern rule with stem `findKey'.
   Trying implicit prerequisite `findKey.c'.
   Looking for a rule with intermediate file `findKey.c'.
    Avoiding implicit rule recursion.
   Trying pattern rule with stem `findKey.'.
   Trying implicit prerequisite `findKey..asm'.
   Looking for a rule with intermediate file `findKey..asm'.
    Avoiding implicit rule recursion.
   Trying pattern rule with stem `findKey.'.
   Trying implicit prerequisite `findKey..s'.
   Looking for a rule with intermediate file `findKey..s'.
    Avoiding implicit rule recursion.
   No implicit rule found for `findKey.o'.
   Finished prerequisites of target file `findKey.o'.
  Must remake target `findKey.o'.

[END Debug output]

然后它抱怨“没有规则来制作目标findKey.o”并停止了。

可能的线索:我从命令行中删除了-R并尝试将findKey.s与其组合,因为它是某种gnu的东西。

想法?

1 个答案:

答案 0 :(得分:1)

仔细看看你的两个汇编规则:

%o: %.asm
    $(ASM) "$<" -O"$(objDir)" -L"$(listDir)" -r -cM t8 --cpu Cortex-M4 --fpu None

%o: %.s
    $(ASM) "$<" -O"$(objDir)" -L"$(listDir)" -r -cM t8 --cpu Cortex-M4 --fpu None

那些应该是%.o,而不是%o。这将是调试输出中的杂散双点的来源以及缺乏正确的“编译.s.o”规则。