summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-06-01 12:19:16 +1000
committerquou <quou@disroot.org>2024-06-01 12:20:17 +1000
commitea7cd94f7aeb177618db3907a6c86b7252e018f0 (patch)
treee972f9cf590ef756c2e41f3eac5b03e16db08300 /Makefile
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..14527e7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+compiler = gcc
+linker = gcc
+cflags = -I./ -g $(includes) $(defines) \
+ -Wall -Wextra -pedantic -std=c99
+lflags = -lX11 -lm
+target = twinkplayer
+includes =
+defines = -Dplat_x11 \
+ -Dplat_posix \
+ -Dplat_pulse \
+ -Dis64bit=1 \
+ -Dplat_x86 \
+ -DDEBUG
+
+sources = \
+ cfgparse.c \
+ font.c \
+ library.c \
+ main.c \
+ memory.c \
+ plat.c \
+ rcache.c \
+ rect.c \
+ render.c \
+ ui.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)