Makefile Syntax

closed account (GbX36Up4)
1
2
3
4
5
6
7
8
9
10
11
12
13
	# Link command:
	ASCII_RPG: main.o get_res.o loadalleg.o header.o functions.o
	c++ main.o get_res.o loadalleg.o header.o functions.o -o ASCII_RPG
    
	# Compilation commands:
	main.o: main.cpp
	c++ -c main.cpp -o main.o
    
	get_res.o: gui.cpp
	c++ -c gui.cpp -o get_res.o
   
	loadalleg.o: loadalleg.cpp
	c++ -c loadalleg.cpp -o loadalleg.o


Error: Makefile:2: *** commands commence before first target. Stop.

I understand that my error is on line 2, and that it has to do with syntax, but I can't figure out what is bothering it. Any help is greatly appreciated.
Did you put a tab before "ASCII_RPG"? Commands begin with a tab, targets don't.
closed account (GbX36Up4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	# Link command:
ASCII_RPG: main.o get_res.o loadalleg.o keyboardinput.o header.o functions.o
		c++ main.o get_res.o loadalleg.o keyboardinput.o header.o functions.o -o ASCII_RPG
    
	# Compilation commands:
	main.o: main.cpp
		c++ -c main.cpp -o main.o
    
	get_res.o: gui.cpp
		c++ -c gui.cpp -o get_res.o
   
	loadalleg.o: loadalleg.cpp
		c++ -c loadalleg.cpp -o loadalleg.o
	
	keyboardinput.o:keyboardinput.cpp
		c++ -c keyboardinput.cpp -o keyboardinput.o


The old error is gone, but there is a new one:
make: *** No rule to make target `main.o', needed by `ASCII_RPG'. Stop.
closed account (GbX36Up4)
Never mind, problem fixed. Thank you for the help. :)
Topic archived. No new replies allowed.