I have a very simple makefile to build a static library that has worked fine for years with GNU make version 3.81 but fails with version 3.82.
I have read up on the issues with backward compatibility and those issues do not appear to apply. I've also checked several posts here, such as Makefile Syntax: Static library lib$(library).a($objects) and Makefile - to create a static library, but cannot find a solution.
Here's my makefile:
FILES = file1.cc file2.cc file3.cc
OBJ_FILES = $(FILES:.cc=.o)
libname.a: libname.a($(OBJ_FILES))
Under version 3.81 this compiles fine using built-in and implicit rules. Sample output
g++ -c -o file1.o file1.cc
ar rv libname.a file1.o
ar: creating libname.a
a - file1.o
but with version 3.82 it fails with
*** No rule to make target `file1.o)'
I've looked at the output of make -d and version 3.82 fails with
No implicit rule found for `file1.o)'.
Finished prerequisites of target file `file1.o)'.
Must remake target `file1.o)'.
make: *** No rule to make target `file1.o)', needed by `libname'. Stop.
while version 3.81 continues without a hitch
Trying implicit prerequisite `file1.o'.
Looking for a rule with intermediate file `file1.o'.
<snip>
Found an implicit rule for `libname.a(file1.o)'.
What gives? Please help! Thanks!