From 822bb45acf93b63e59071903aad842a3dd92a915 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 26 Aug 2016 08:43:12 -0400 Subject: [PATCH 1/1] Rewrite the Makefile to fix CC, CFLAGS, and LDFLAGS support. The existing Makefile did not allow the user to set CC, CFLAGS, or LDFLAGS (or at least, they were ignored). This was fixed somewhat easily by deleting most of the Makefile, and by appending the necessary flags to CFLAGS and LDFLAGS. The installation target didn't do the right thing anyway, so it has been removed. The resulting Makefile is probably only useful on Gentoo, but upstream is long gone so maybe that's not a problem. Gentoo-Bug: 335033 --- Makefile | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 7916cab..43a0527 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,12 @@ GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags` GTK_LIB = `pkg-config gtk+-2.0 --libs` -INSTALLDIR = /usr/lib/gkrellm2/plugins - -FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) +CFLAGS += -fPIC $(GTK_INCLUDE) LIBS = $(GTK_LIB) -LFLAGS = -shared - -CC = gcc - -OBJS = gkrellfire.o - -all: gkrellfire.so - -%.o: %.c - $(CC) $(CFLAGS) $(FLAGS) -c -o $@ $< +LDFLAGS += -shared - -gkrellfire.so: $(OBJS) - $(CC) $(CFLAGS) $(OBJS) -o gkrellfire.so $(LFLAGS) $(LIBS) +gkrellfire.so: gkrellfire.o + $(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS) clean: - rm -f *.o core *.so* *.bak *~ - -gkrellfire.o: gkrellfire.c - -install: - if [ -d $(INSTALLDIR) ] ; then \ - install -c -s -m 644 gkrellfire.so $(INSTALLDIR) ; \ - else \ - install -D -c -s -m 644 gkrellfire.so $(INSTALLDIR)/gkrellfire.so ; \ - fi - -uninstall: - rm -f $(INSTALLDIR)/gkrellfire.so + rm -f gkrellfire.*o -- 2.7.3