summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-03-14 08:40:53 +0100
committerMikhail Burakov <mburakov@mailbox.org>2023-03-14 08:40:53 +0100
commit1c79dfed2c973b159b8f4a39a8087f772b70ceb0 (patch)
treec7ea2fc1d0d15557c16c16372761e3c1bf1d1903 /makefile
Initial import of streamer source code
Diffstat (limited to 'makefile')
-rw-r--r--makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..c3146b8
--- /dev/null
+++ b/makefile
@@ -0,0 +1,39 @@
+bin:=$(notdir $(shell pwd))
+src:=$(shell ls *.c)
+obj:=$(src:.c=.o)
+
+libs:=\
+ egl \
+ glesv2 \
+ libavcodec \
+ libavutil \
+ libdrm \
+ libva
+
+res:=\
+ vertex.glsl \
+ luma.glsl \
+ chroma.glsl
+
+
+CFLAGS+=$(shell pkg-config --cflags $(libs))
+LDFLAGS+=$(shell pkg-config --libs $(libs))
+
+comma:=,
+LDFLAGS+= \
+ -Wl,--format=binary \
+ $(patsubst %,-Wl$(comma)%,$(res)) \
+ -Wl,--format=default
+
+all: $(bin)
+
+$(bin): $(obj)
+ $(CC) $^ $(LDFLAGS) -o $@
+
+%.o: %.c *.h $(res)
+ $(CC) -c $< $(CFLAGS) -o $@
+
+clean:
+ -rm $(bin) $(obj)
+
+.PHONY: all clean