diff options
author | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-04-10 13:29:11 +0200 |
---|---|---|
committer | hans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain> | 2009-04-10 13:29:11 +0200 |
commit | 8fabb280152af70dddc25fd3c57a346b94326a33 (patch) | |
tree | ece926db290a309844a0cf2e4d3f8068cb300d25 /v4l2-apps/libv4l/libv4l2 | |
parent | 4f4f2f81fd16cc9a8b777452b64b3b2ffb4d819c (diff) | |
download | mediapointer-dvb-s2-8fabb280152af70dddc25fd3c57a346b94326a33.tar.gz mediapointer-dvb-s2-8fabb280152af70dddc25fd3c57a346b94326a33.tar.bz2 |
libv4l: Adds Makefile pre-requisites to libv4l
From: Gilles Gigan <gilles.gigan@gmail.com>
This patch update libv4l's Makefiles so they automatically update and
include dependency information for each source file.
Priority: normal
Signed-off-by: Gilles Gigan <gilles.gigan@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l/libv4l2')
-rw-r--r-- | v4l2-apps/libv4l/libv4l2/Makefile | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/v4l2-apps/libv4l/libv4l2/Makefile b/v4l2-apps/libv4l/libv4l2/Makefile index 614b36cf8..c3af123c8 100644 --- a/v4l2-apps/libv4l/libv4l2/Makefile +++ b/v4l2-apps/libv4l/libv4l2/Makefile @@ -13,9 +13,10 @@ INCLUDES = ../include/libv4l2.h ifeq ($(LINKTYPE),static) V4L2_LIB = libv4l2.a +V4L2_DEPS = $(V4L2_OBJS) else V4L2_LIB = libv4l2.so -V4L2_OBJS += ../libv4lconvert/libv4lconvert.so +V4L2_DEPS += $(V4L2_OBJS) ../libv4lconvert/libv4lconvert.so TARGETS += $(V4L2CONVERT) override CPPFLAGS += -fPIC endif @@ -34,7 +35,9 @@ endif all: $(TARGETS) -$(V4L2_LIB): $(V4L2_OBJS) +include $(V4L2_OBJS:.o=.d) + +$(V4L2_LIB): $(V4L2_DEPS) $(V4L2CONVERT): $(V4L2CONVERT_O) $(V4L2_LIB) @@ -70,8 +73,12 @@ endif clean:: rm -f *.a *.so* *.o *.d libv4l2.pc log *~ *.orig *.rej +%.d: %.c + @set -e; rm -f $@; \ + gcc -MM $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ + %.o: %.c - $(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< %.so: $(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ $(LIBS_$*) |