After a bit of searching, I\'ve managed to throw together the following Makefile:
CC = gcc CFLAGS = -c -Wall LDFLAGS = SOURCEFILES = main.c SOURCES = src/$(
Something like this?
SOURCES = src/main.c OBJECTS = obj/main.o ... obj/%.o: src/%.c $(CC) $(CFLAGS) $< -o $@
Once that's working, you can add further tricks, like this:
OBJECTS = $(patsubst src/%.c, obj/%.o, $(SOURCES)