blob: 3fd561f4e9d749ac5b958c8b91bdf5006fbc31b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
CC = gcc
LD = gcc
CPPFLAGS = -fPIC -I../include -I../../../../linux/include
CFLAGS := -g -O1
CFLAGS += -Wall -W -Wno-unused -Wpointer-arith -Wstrict-prototypes
LDFLAGS = -shared
CONVERT_LIB = libv4lconvert.so
CONVERT_OBJS = libv4lconvert.o tinyjpeg.o sn9c10x.o pac207.o \
jidctflt.o spca561-decompress.o rgbyuv.o spca501.o bayer.o
TARGETS = $(CONVERT_LIB) libv4lconvert.pc
INCLUDES = ../include/libv4lconvert.h
ifeq ($(LIB_RELEASE),)
LIB_RELEASE = 0
endif
ifeq ($(PREFIX),)
PREFIX = /usr/local
endif
ifeq ($(LIBDIR),)
LIBDIR = $(PREFIX)/lib
endif
all: $(TARGETS)
$(CONVERT_LIB): $(CONVERT_OBJS)
libv4lconvert.pc:
echo prefix=$(PREFIX) > libv4lconvert.pc
echo libdir=$(LIBDIR) >> libv4lconvert.pc
echo >> libv4lconvert.pc
echo 'Name: libv4lconvert' >> libv4lconvert.pc
echo 'Description: v4l format conversion library' >> libv4lconvert.pc
echo 'Version: '$(V4L2_LIB_VERSION) >> libv4lconvert.pc
echo 'Libs: -L$${libdir} -lv4lconvert' >> libv4lconvert.pc
echo 'Cflags: -I$${prefix}/include' >> libv4lconvert.pc
install: all
mkdir -p $(DESTDIR)$(PREFIX)/include
install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include
mkdir -p $(DESTDIR)$(LIBDIR)
install -m 755 $(CONVERT_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR)
cd $(DESTDIR)$(LIBDIR) && \
ln -f -s $(CONVERT_LIB).$(LIB_RELEASE) $(CONVERT_LIB)
mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
install -m 644 libv4lconvert.pc $(DESTDIR)$(LIBDIR)/pkgconfig
clean::
rm -f *.so* *.o *.d libv4lconvert.pc log *~
%.o: %.c
$(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $<
%.so:
$(CC) $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^
ln -f -s $@.$(LIB_RELEASE) $@
|