MrDuk
MrDuk

Reputation: 18242

Can't get 'make' to work on OSX; have to use 'make -f <file>'

I'm trying to get started building my own make files, but am having some trouble getting my Mac to use them. I can issue the command make -f makefile.txt and it compiles my project fine; however, just using make produces the following:

make: *** No targets specified and no makefile found.  Stop.

My makefile looks like this:

all:
        g++ main.c -o hello

Am I doing something wrong?

Upvotes: 1

Views: 4610

Answers (1)

user149341
user149341

Reputation:

You're naming the Makefile inappropriately. It should be named simply Makefile (with no extension), not makefile.txt.

Upvotes: 4

Related Questions