From 40536a32a310338da9cf2c697dd978780aeda18a Mon Sep 17 00:00:00 2001 From: Thierry MERLE Date: Fri, 4 Jul 2008 19:28:49 +0200 Subject: v4l2-library: libv4l-makefile-improvements.patch From: Hans de Goede Makefile improvements: * Split DESTDIR into DESTDIR and PREFIX as used in most makefiles out there * Add LIBDIR variable to allow installation in /lib64 for example * Install the wrappers in /libv4l instead of directly under libdir, as they are not libraries meant for linking * preserve timestamps of header files when installing them Signed-off-by: Hans de Goede Signed-off-by: Thierry MERLE --- v4l2-apps/lib/libv4l/libv4l1/Makefile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'v4l2-apps/lib/libv4l/libv4l1') diff --git a/v4l2-apps/lib/libv4l/libv4l1/Makefile b/v4l2-apps/lib/libv4l/libv4l1/Makefile index c679d35d8..8cb064cd4 100644 --- a/v4l2-apps/lib/libv4l/libv4l1/Makefile +++ b/v4l2-apps/lib/libv4l/libv4l1/Makefile @@ -19,8 +19,12 @@ ifeq ($(LIB_RELEASE),) LIB_RELEASE = 0 endif -ifeq ($(DESTDIR),) -DESTDIR = /usr/local +ifeq ($(PREFIX),) +PREFIX = /usr/local +endif + +ifeq ($(LIBDIR),) +LIBDIR = $(PREFIX)/lib endif all: $(TARGETS) @@ -31,15 +35,14 @@ $(V4L1_LIB): $(V4L1_OBJS) $(V4L1COMPAT): $(V4L1COMPAT_O) $(V4L1_LIB) install: all - mkdir -p $(DESTDIR)/include - cp $(INCLUDES) $(DESTDIR)/include - mkdir -p $(DESTDIR)/lib - cp $(V4L1_LIB).$(LIB_RELEASE) $(DESTDIR)/lib - cd $(DESTDIR)/lib && \ + mkdir -p $(DESTDIR)$(PREFIX)/include + install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include + mkdir -p $(DESTDIR)$(LIBDIR)/libv4l + install -m 755 $(V4L1_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR) + cd $(DESTDIR)$(LIBDIR) && \ ln -f -s $(V4L1_LIB).$(LIB_RELEASE) $(V4L1_LIB) - cp $(V4L1COMPAT).$(LIB_RELEASE) $(DESTDIR)/lib - cd $(DESTDIR)/lib && \ - ln -f -s $(V4L1COMPAT).$(LIB_RELEASE) $(V4L1COMPAT) + install -m 755 $(V4L1COMPAT).$(LIB_RELEASE) \ + $(DESTDIR)$(LIBDIR)/libv4l/$(V4L1COMPAT) clean:: rm -f *.so* *.o log *~ -- cgit v1.2.3