compiler = gcc linker = gcc cflags = -I./ -g -DDEBUG -Dplat_x11 -Dplat_x86 \ -Dplat_posix -Dallocation_default_alignment=8 \ -Wall -Wextra -pedantic -std=c90 lflags = -lX11 target = 3de sources = \ 3de.c \ maths.c \ memory.c \ plat.c \ rect.c \ render.c objects = $(sources:%.c=%.o) all: $(target) $(objects): %.o : %.c $(compiler) -MMD -MF $(basename $@).d $(cflags) -o $@ -c $< $(target): $(objects) $(linker) $(objects) -o $@ $(lflags) clean: rm *.d rm *.o rm $(target) -include $(sources:%.c=%.d)