CFLAGS = $(shell pkg-config gl --cflags) $(shell pkg-config x11 --cflags) LIBS = $(shell pkg-config gl --libs) $(shell pkg-config x11 --libs) all: app gltest.so gltest.so: gltest.c $(CC) $(CFLAGS) -fPIC -o $@ $< -shared $(LIBS) app: app.c $(CC) -o $@ $< -ldl clean: rm -f *.o app gltest.so