From 8ea6477a2c5bee6c5f294fd370aab31e358c04d4 Mon Sep 17 00:00:00 2001 From: Earnestly Date: Tue, 24 Jan 2017 12:51:42 +0000 Subject: Add a simple makefile --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2