From 599ab946697b1dd053c467619e04456ccb71789b Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Sun, 10 Jun 2007 20:13:26 +0000 Subject: -optimize 'pkg-config' call --- Makefile | 30 ++++++++++++++++++++++-------- liboutput/Makefile | 18 ++++++++++++++---- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 856b298..1963e1e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # Makefile for Image plugin to VDR # -# (C) 2004-2006 Andreas Brachold +# (C) 2004-2007 Andreas Brachold # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -93,18 +93,30 @@ ifeq ($(LIBAVCODECVERSION),51) LIBS += -L$(FFMDIR)/libavformat -L$(FFMDIR)/libavutil LIBS += -lavformat -lavutil endif +ifndef WITHOUT_SWSCALER + DEFINES += -DHAVE_SWSCALER + LIBS += -L$(FFMDIR)/libswscale -lswscale +endif else - LIBS += $(shell $(PKG-CONFIG) --libs libavcodec) + PKG-LIBS += libavcodec +ifndef WITHOUT_SWSCALER + PKG-LIBS += libswscale +endif endif ifndef WITHOUT_LIBEXIF - INCLUDES += $(shell $(PKG-CONFIG) --cflags libexif) - LIBS += $(shell $(PKG-CONFIG) --libs libexif) + PKG-INCLUDES += libexif + PKG-LIBS += libexif DEFINES += -DHAVE_LIBEXIF endif -ifndef WITHOUT_SWSCALER - LIBS += $(shell $(PKG-CONFIG) --libs libswscale) + +ifdef PKG-INCLUDES +INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES)) +endif + +ifdef PKG-LIBS +LIBS += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS)) endif ### The object files (add further files here): @@ -167,8 +179,7 @@ dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tar.gz -clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~ examples/*~ scripts/*~ +subdirs-clean: @for i in $(SUBDIRS) ;\ do \ ( cd $$i;\ @@ -176,3 +187,6 @@ clean: ) \ || exit 1;\ done + +clean: subdirs-clean + @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~ examples/*~ scripts/*~ diff --git a/liboutput/Makefile b/liboutput/Makefile index 7300393..0392ce4 100644 --- a/liboutput/Makefile +++ b/liboutput/Makefile @@ -20,17 +20,27 @@ INCLUDES += -I$(VDRDIR)/include -I. ifdef FFMDIR INCLUDES += -I$(FFMDIR)/libavcodec -I$(FFMDIR)/libavutil DEFINES += -DFFMDIR +ifndef WITHOUT_SWSCALER + DEFINES += -DHAVE_SWSCALER + INCLUDES += -I$(FFMDIR)/libswscale +endif else - INCLUDES += $(shell $(PKG-CONFIG) --cflags libavcodec) + +ifndef WITHOUT_SWSCALER + DEFINES += -DHAVE_SWSCALER + PKG-INCLUDES += libswscale +endif + + PKG-INCLUDES += libavcodec endif DEFINES += -D_GNU_SOURCE -ifndef WITHOUT_SWSCALER - DEFINES += -DHAVE_SWSCALER - INCLUDES += $(shell $(PKG-CONFIG) --cflags libswscale) +ifdef PKG-INCLUDES +INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES)) endif + ### The object files (add further files here): OBJS = encode.o stillimage.o stillimage-player.o -- cgit v1.2.3