You might like to use variables at the top of the file so you don't have to change everything in every line. Just makes neater code.
Example:
Code:
CFLAGS=-W -Wall -ggdb `sdl-config --cflags`
LIBS=-lm `sdl-config --libs`
OBJS=main.o particle.o background.o resources.o
CC=g++
default:
@echo 'Plese check the variables at the top of the Makefile, then run make program.'
clean:
rm -f program $(OBJS)
rm -f *~
program: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o program $(LIBS)
main.o: main.cpp gamedefs.h
$(CC) $(CFLAGS) -c main.cpp
particle.o: particle.cpp particle.h gamedefs.h
$(CC) $(CFLAGS) -c particle.cpp
background.o: background.cpp background.h gamedefs.h
$(CC) $(CFLAGS) -c background.cpp
resources.o: resources.cpp resources.h gamedefs.h
$(CC) $(CFLAGS) -c resources.cpp
That's hopefully helpful. Sorry if it isn't. I know that three modules isn't anything big, but later on, this would save a lot of time.