Separate library install into static and shared installation.
[libav.git] / libavcodec / libpostproc / Makefile
1
2 include ../../config.mak
3
4 VPATH=$(SRC_PATH)/libavcodec/libpostproc
5
6 NAME=postproc
7 ifeq ($(BUILD_SHARED),yes)
8 LIBVERSION=$(SPPVERSION)
9 LIBMAJOR=$(SPPMAJOR)
10 endif
11
12 OBJS=postprocess.o
13 SOBJS=postprocess_pic.o
14
15 CFLAGS = $(OPTFLAGS) $(MLIB_INC) -I. -I.. $(EXTRA_INC)
16 # -I/usr/X11R6/include/
17
18 .SUFFIXES: .c .o
19
20 # .PHONY: all clean
21
22 .c.o:
23 $(CC) -c $(CFLAGS) $(LIBOBJFLAGS) -I$(SRC_PATH)/libavcodec -I../.. -o $@ $<
24
25 all: $(SWSLIB) $(LIB) $(SLIBNAME)
26
27 clean:
28 rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
29
30 distclean: clean
31 rm -f .depend
32
33 dep: depend
34
35 depend:
36 $(CC) -MM $(CFLAGS) postprocess.c 1>.depend
37
38 ifeq ($(BUILD_SHARED),yes)
39 postprocess_pic.o: postprocess.c
40 $(CC) -c $(CFLAGS) -fomit-frame-pointer -fPIC -DPIC -I.. -I../.. -o $@ $<
41
42 $(SLIBNAME): $(SOBJS)
43 $(CC) $(SHFLAGS) -o $(SLIBNAME) $(SOBJS)
44 endif
45
46 $(LIB): $(OBJS)
47 rm -f $@
48 $(AR) rc $@ $(OBJS)
49 $(RANLIB) $@
50
51
52 install-lib-shared: $(SLIBNAME)
53 ifeq ($(CONFIG_WIN32),yes)
54 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
55 else
56 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
57 $(libdir)/$(SLIBNAME_WITH_VERSION)
58 ln -sf $(SLIBNAME_WITH_VERSION) \
59 $(libdir)/$(SLIBNAME_WITH_MAJOR)
60 ln -sf $(SLIBNAME_WITH_VERSION) \
61 $(libdir)/$(SLIBNAME)
62 endif
63
64 install-lib-static: $(LIB)
65 install -m 644 $(LIB) "$(libdir)"
66
67 install-headers:
68 mkdir -p $(prefix)/include/postproc
69 install -m 644 $(SRC_PATH)/libavcodec/libpostproc/postprocess.h $(prefix)/include/postproc/postprocess.h
70 install -d $(libdir)/pkgconfig
71 install -m 644 ../../libpostproc.pc $(libdir)/pkgconfig
72
73
74 #
75 # include dependency files if they exist
76 #
77 ifneq ($(wildcard .depend),)
78 include .depend
79 endif