2

I have a small C program that just computes Fibonacci. I have make file to build the file, and when I call make, I get the message make: *** No targets specified and no makefile found. Stop.. If I call make clean, I get make: *** No rule to make target `clean'. Stop. but it seems to see a makeFile (I think). I'm pretty lost and need help.

Here's the text of the make file:

CC=gcc

all: fibonacci

fibonacci: fibonacci.c 
    $(CC) -pthread -o fib.exe

clean: 
    rm fib.e xe
rici
  • 234,347
  • 28
  • 237
  • 341
icaughtfireonce
  • 171
  • 1
  • 10

2 Answers2

2

rename your makefile to Makefile or use make -f <whatever_name_you_like>. Remember that in unix-like systems file names are often case-sensitive (not in all types of filesystems but in many)

user3159253
  • 16,836
  • 3
  • 30
  • 56
2

Refer this answer No targets specified and no makefile found

By default, when make looks for the makefile, it tries the following names, in order: GNUmakefile, makefile and Makefile.

You can also try make all and read

What Name to Give Your Makefile

Community
  • 1
  • 1
Punit Vara
  • 3,744
  • 1
  • 16
  • 30