Hi,

my reading of the manual for GNU make (v3.82) was that a simple
makefile consisting of:

main: main.o

in a project consisting of a single main.cpp file would invoke g++ and generate
.o from .cpp and main by linking with g++. This is not what I see and
it comes as
a surprise.

The first implicit rule picked up is to link main from main.o with cc
rather than g++.

I can work around this by specifying a rule such as $(LINK.cc) -o $@
$< but I'm wondering if I'm missing something.

My question is "what is the most robust/concise way to write a
makefile for generating cpp applications from a single cpp file?"

Regards,


Amit

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to