Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Makefile:9: *** missing separator. Stop

Tags:

makefile

I'm trying to write a simple makefile, am getting missing separator:

CC =  g++
CFLAGS =  -Wall -g

all:  compile 

compile:  array.cpp
  $(CC) $(CFLAGS)  array.cpp

run:  ./result.out
like image 787
Manu N Avatar asked Oct 18 '25 14:10

Manu N


1 Answers

Try

CC = g++ 
CFLAGS = -Wall -g

all: compile

compile: array.cpp
    $(CC) $(CFLAGS) array.cpp

run: 
    ./result.out

And make sure you use tabs for indentation, not spaces.

like image 137
Vaibhav Sagar Avatar answered Oct 21 '25 04:10

Vaibhav Sagar