Respect the user's pkg-config, remove "-O2 -Wall" flags, don't call gcc directly --- a/Makefile +++ b/Makefile @@ -1,16 +1,17 @@ -GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags` -GTK_LIB = `pkg-config gtk+-2.0 --libs` +PKG_CONFIG ?= pkg-config +GTK_INCLUDE = $(shell ${PKG_CONFIG} gtk+-2.0 --cflags) +GTK_LIB = $(shell ${PKG_CONFIG} gtk+-2.0 --libs) -FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) +FLAGS = -fPIC $(GTK_INCLUDE) LIBS = $(GTK_LIB) LFLAGS = -shared -CC = gcc $(CFLAGS) $(FLAGS) +CC = $(CC) OBJS = gkrellstock.o gkrellstock.so: $(OBJS) - $(CC) $(LDFLAGS) $(OBJS) -o gkrellstock.so $(LFLAGS) $(LIBS) + $(CC) $(CFLAGS) $(FLAGS) $(LDFLAGS) $(OBJS) -o gkrellstock.so $(LFLAGS) $(LIBS) clean: rm -f *.o core *.so* *.bak *~