summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEarnestly <zibeon@googlemail.com>2017-01-24 12:51:42 +0000
committerJari Vetoniemi <mailroxas@gmail.com>2017-01-31 21:53:12 +0200
commit8ea6477a2c5bee6c5f294fd370aab31e358c04d4 (patch)
tree4f762ad0c2dd3214cf35ba70f736d026c18c1181 /Makefile
parentfe3f6a4818fc198dba4ecde07151d21665e1f987 (diff)
Add a simple makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b40d039
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+PREFIX ?= /usr/local
+libdir ?= /lib
+
+WARNINGS := -Wall -Wextra -Wformat=2 -Winit-self -Wfloat-equal -Wcast-align -Wpointer-arith
+CFLAGS += -std=c99 $(WARNINGS) $(shell pkg-config --cflags alsa)
+
+%.so: %.o
+ $(LINK.o) -shared $^ $(LDLIBS) -o $@
+
+all: glcapture.so
+
+glcapture.so: LDFLAGS += $(shell pkg-config --libs-only-L --libs-only-other alsa) -Wl,-soname,glcapture.so
+glcapture.so: LDLIBS := $(shell pkg-config --libs-only-l alsa)
+
+glcapture.o: CFLAGS += -fPIC
+glcapture.o: glcapture.c hooks.h glwrangle.h
+
+install:
+ install -Dm644 glcapture.so $(DESTDIR)$(PREFIX)$(libdir)/glcapture.so
+
+clean:
+ $(RM) glcapture.*o
+
+.PHONY: all clean install