From 040a45bba01edb885faddac75025f88e655b89be Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 4 Apr 2012 17:53:57 +0200 Subject: Makefile: Use -Wl,--as-needed --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 65c0cfe..64074dc 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CC = gcc CFLAGS = -ggdb -std=c99 -pedantic -Wall $(DEFINES) \ $(shell pkg-config --cflags gdk-pixbuf-2.0 glib-2.0 gthread-2.0) \ -DN_THREADS=$(shell grep -c ^processor /proc/cpuinfo || echo 2) -LDFLAGS = $(LIBS) -lm \ +LDFLAGS = -Wl,--as-needed $(LIBS) -lm \ $(shell pkg-config --libs gdk-pixbuf-2.0 glib-2.0 gthread-2.0) PROGS = wimmel wimmel_gl roi capture @@ -18,24 +18,24 @@ capture: capture.o .PHONY: clean all %: - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ + $(CC) -o $@ $+ $(LDFLAGS) %.o: %.c %.h $(CC) $(CFLAGS) -c -o $@ $< wimmel_gl: - $(CC) $(LDFLAGS) `pkg-config --cflags --libs egl glesv2` -o $@ $+ + $(CC) -o $@ $+ $(LDFLAGS) `pkg-config --cflags --libs egl glesv2` roi.o: roi.c - $(CC) $(CFLAGS) `pkg-config --cflags gtk+-3.0` -c -o $@ $< + $(CC) -c -o $@ $+ $(CFLAGS) `pkg-config --cflags gtk+-3.0` roi: - $(CC) $(LDFLAGS) `pkg-config --libs gtk+-3.0` -o $@ $+ + $(CC) -o $@ $+ $(LDFLAGS) `pkg-config --libs gtk+-3.0` capture.o: capture.c - $(CC) $(CFLAGS) `pkg-config --cflags gtk+-3.0 opencv` -c -o $@ $< + $(CC) -c -o $@ $+ $(CFLAGS) `pkg-config --cflags gtk+-3.0 opencv` capture: - $(CC) $(LDFLAGS) `pkg-config --libs gtk+-3.0 opencv` -o $@ $+ + $(CC) -o $@ $+ $(LDFLAGS) `pkg-config --libs gtk+-3.0 opencv` clean: rm -f $(PROGS) $(OBJS) -- cgit