18
HEADERS = schedule.h 

default: papcmp

program.o: schedule.c $(HEADERS)
    gcc -g -lnuma -lm -pthread schedule.c -lutil -lz -o schedule.o

program: schedule.o
    gcc schedule.o -o papcmp

clean:
    -rm -f schedule.o
    -rm -f papcmp
    -rm -f *.log dump.gz

This is the first time i'm trying to create a make file. and it looks like there is an error. Could you help me with it? The line that is in bold has the error according to the output.

pistal
  • 2,310
  • 13
  • 41
  • 65
  • Whey do you have ** in your file? Remove those. And it looks like you are trying to build program.o but tell it to output schedule.o – RedX Jun 10 '14 at 16:01
  • I don't have the **. That's how SO represents **Bold** for code. – pistal Jun 10 '14 at 16:02
  • possible duplicate of [makefile:4: \*\*\* missing separator. Stop](http://stackoverflow.com/questions/16931770/makefile4-missing-separator-stop) – nneonneo Jun 10 '14 at 16:03

2 Answers2

45

Make is very picky about spaces vs. tabs. Command lines absolutely must be indented with a single tab, and not spaces. You may need to adjust your editor to generate tab characters.

nneonneo
  • 171,345
  • 36
  • 312
  • 383
  • Ok. Let me try. Could you also look at this: http://stackoverflow.com/questions/24142856/usage-of-pseudo-terminal-c please – pistal Jun 10 '14 at 16:03
  • This is what I get now: make: *** No rule to make target `papcmp', needed by `default'. Stop. – pistal Jun 10 '14 at 16:04
  • @pistal: that would be a completely different problem. (Hint: `papcmp` isn't a target in your Makefile). – nneonneo Jun 10 '14 at 16:05
  • Ok. Got that. Thanks! Any idea how to solve the other issue? been stuck with it for a while now. – pistal Jun 10 '14 at 16:07
  • That is also a completely different problem...please don't drag one problem into another. – nneonneo Jun 10 '14 at 16:08
  • Alright. I'll wait for the timer to go away so that I mark your answer. In case, you can help me with the other one, please do so. – pistal Jun 10 '14 at 16:09
0

Make TAB to make it work!


Example working code with TAB symbol as orange line

working version


Original code with spaces highlighted in Notepad++:

your code in Notepad++ with spaces highlighted

Curious Watcher
  • 580
  • 6
  • 12