Bill Clar
Bill Clar

Reputation: 149

Eclipse Makefile - no rule to make target

I'm trying to debug a custom Makefile from an open source C++ project. It's not recognizing any targets I make in the "Make Target" view.

I've triple checked the spelling of my targets and they're fine.

If I turn on "Generate Makefiles automatically" it will successfully call the "all" and "clean" targets, but no other targets.

Upvotes: 0

Views: 2607

Answers (2)

resigned
resigned

Reputation: 1084

Glad that solved your problem. By the way you don't have to have the make file in the same location as your source files. Here is an example where we use a make file in one directory that uses cd to run make files in other directories:

all: subsystems

subsystems:
    @cd Efficiency && $(MAKE)
    @cd List && $(MAKE)
    @cd Map && $(MAKE)
    @cd Set && $(MAKE)
    @cd UsingSTLEfficiently && $(MAKE)
    @cd VectorAndArray && $(MAKE)

Upvotes: 0

resigned
resigned

Reputation: 1084

I assume you are using Eclipse/CDT.

Don't choose automatically generate Makefile. Instead, right click on the makefile and select Make Targets/create. Use the target names from the makefile. The targets will appear in the "Make Targets" window (Window/Show View/MakeTarget). You can then build any of the targets using the hammer symbol in the make targets window.

Upvotes: 1

Related Questions