blob: c3cc999821290122a9f5268c25308f8783581937 (
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
|
PREFIX ?= /usr/local
SYSLIBDIR = $(PREFIX)/lib
LIBNAME=libwebvi.so
LIBSONAME=$(LIBNAME).1
LIBMINOR=$(LIBSONAME).0
VERSION:=$(shell grep VERSION webvi/version.py | cut -d \' -f 2)
PYLIB:=$(shell python pythonlibname.py)
DEFINES:=-DPYTHONSHAREDLIB=\"$(PYLIB)\" -DLIBWEBVI_VERSION=\"$(VERSION)\"
# append -DDEBUG to DEFINES to get debug output
all: $(LIBMINOR)
libwebvi.o: libwebvi.c libwebvi.h
$(CC) -fPIC -Wall -O2 -g $(CFLAGS) $(DEFINES) `python-config --cflags` -c -o libwebvi.o libwebvi.c
$(LIBMINOR): libwebvi.o
$(CC) -shared -Wl,-soname,$(LIBSONAME) -Wl,--as-needed libwebvi.o `python-config --ldflags` $(LDFLAGS) -o $(LIBMINOR)
ln -sf $(LIBMINOR) $(LIBSONAME)
ln -sf $(LIBSONAME) $(LIBNAME)
libwebvi.so: $(LIBMINOR)
libwebvi.a: libwebvi.o
ar rsc libwebvi.a libwebvi.o
clean:
rm -f *.o *~ libwebvi.so* libwebvi.a
rm -f webvi/*.pyc webvi/*~
install: $(LIBMINOR)
mkdir -p $(DESTDIR)$(SYSLIBDIR)
cp --remove-destination -d $(LIBNAME)* $(DESTDIR)$(SYSLIBDIR)
/sbin/ldconfig $${DESTDIR:+-N} $(DESTDIR)$(SYSLIBDIR)
.PHONY: clean install
|