diff options
-rw-r--r-- | v4l2-apps/libv4l/libv4l1/Makefile | 12 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4l2/Makefile | 13 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4lconvert/Makefile | 8 |
3 files changed, 26 insertions, 7 deletions
diff --git a/v4l2-apps/libv4l/libv4l1/Makefile b/v4l2-apps/libv4l/libv4l1/Makefile index 9f30cbb0f..d228cc916 100644 --- a/v4l2-apps/libv4l/libv4l1/Makefile +++ b/v4l2-apps/libv4l/libv4l1/Makefile @@ -13,9 +13,10 @@ INCLUDES = ../include/libv4l1.h ifeq ($(LINKTYPE),static) V4L1_LIB = libv4l1.a +V4L1_DEPS = $(V4L1_OBJS) else V4L1_LIB = libv4l1.so -V4L1_OBJS += ../libv4l2/libv4l2.so +V4L1_DEPS += $(V4L1_OBJS) ../libv4l2/libv4l2.so TARGETS += $(V4L1COMPAT) override CPPFLAGS += -fPIC endif @@ -34,8 +35,9 @@ endif all: $(TARGETS) +include $(V4L1_OBJS:.o=.d) -$(V4L1_LIB): $(V4L1_OBJS) +$(V4L1_LIB): $(V4L1_DEPS) $(V4L1COMPAT): $(V4L1COMPAT_O) $(V4L1_LIB) @@ -71,8 +73,12 @@ endif clean:: rm -f *.a *.so* *.o *.d libv4l1.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_$*) 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_$*) diff --git a/v4l2-apps/libv4l/libv4lconvert/Makefile b/v4l2-apps/libv4l/libv4lconvert/Makefile index f779011b4..95b9d31d9 100644 --- a/v4l2-apps/libv4l/libv4lconvert/Makefile +++ b/v4l2-apps/libv4l/libv4lconvert/Makefile @@ -30,6 +30,8 @@ endif all: $(TARGETS) +include $(CONVERT_OBJS:.o=.d) + $(CONVERT_LIB): $(CONVERT_OBJS) libv4lconvert.pc: @@ -60,8 +62,12 @@ endif clean:: rm -f *.a *.so* *.o *.d libv4lconvert.pc log *~ *.orig *.rej +%.d:: %.c + @set -e; rm -f $@; \ + $(CC) -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) $^ |