Here's the solution to the problem: make has a built-in implicit rule to
make .o files from .c files. I was pretty sure my rule to create .o
files from .s files would override this implicit rule, but it does so
ONLY IF THE .s FILE ALREADY EXISTS! So the implicit rule has to be
explicitly canceled <grin> by adding
%.o: %.c
(with no commands) to the top of the file. For more information read:
http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC105
http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC114
--
Sebastian Schuberth
Hi,
in my makefile I have two simple rules:
prefix_%.s: prefix_%.c
# Do something
prefix_%.o: prefix_%.s
# Do something
The file prefix_test.c exists. When I type "make prefix_test.o", instead
of my rule some default rule (which is not present in the file)
launching "cc" is run. However, running "make prefix_test.s" works, and
running "make prefix_test.o" afterwards (so prefix_test.s exists) works
then, too. Why is that? Why can't I create both "prefix_test.s" and
"prefix_test.o" in a single step by launching "make prefix_test.o"?
Thanks for any insights.
_______________________________________________
help-gnu-utils mailing list
help-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-utils