Essentially the problem with yours is that when you type 'make' it will run the first rule, which is
What you need instead is
Code:
all: xyz.o abc.o
gcc xyz.o abc.o -o executable
However, you could also do is:
Code:
OBJECTS = abc.o xyz.o
all: $(OBJECTS)
gcc $(OBJECTS) -o executable
%.o: %.c
gcc -c $<
So the bottom bit is a rule to change a .c file to a .o file, the middle bit says that to make the executable you need objects 'abc.o' and 'xyz.o' and how to combine them to make the executable using gcc, and the first line lists all the objects you need.
Hope this helps,