summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-06-30 18:24:01 +1000
committerquou <quou@disroot.org>2024-06-30 18:27:11 +1000
commit39100e7292d3ee12d387fddfa0f0d7b712e31e1c (patch)
tree28f26b19de857868aeb9ecf23a7fecfc170addf9 /Makefile
initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8b774cd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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)