summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8b774cd5e3285efe0ed488f1e35996ef4450cb86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)