n00
n00

Reputation: 83

Automake generated makefile has compile command commented out

I created a autotools project and in Makefile.am I have:

bin_PROGRAMS = myBin
myBin_SOURCES = src/main.cpp

The generated makefile has this target:

.cpp.o:
#   $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
#   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
    source='$<' object='$@' libtool=no \
    DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
    $(CXXCOMPILE) -c -o $@ $<

As you can see, the actual compiler invocation is commented out. Why?

Upvotes: 0

Views: 262

Answers (1)

Jack Kelly
Jack Kelly

Reputation: 18667

Depending on what dependency tracking is detected/requested at configure time, different parts of the compile command will be commented out. Substituting # into Makefile in strategic places is how automake implements conditionals. Try to find the original lines in Makefile.in and have a look.

Upvotes: 2

Related Questions