replace printf by av_log
[libav.git] / subdir.mak
CommitLineData
71c61f62
MR
1SRC_DIR := $(SRC_PATH_BARE)/lib$(NAME)
2
3include $(SUBDIR)../common.mak
4
5LIBVERSION := $(lib$(NAME)_VERSION)
6LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
7
8ifeq ($(BUILD_STATIC),yes)
9all: $(SUBDIR)$(LIBNAME)
10
11install-libs: install-lib$(NAME)-static
12
13$(SUBDIR)$(LIBNAME): $(OBJS)
14 rm -f $@
15 $(AR) rc $@ $^ $(EXTRAOBJS)
16 $(RANLIB) $@
17endif
18
19INCINSTDIR := $(INCDIR)/lib$(NAME)
20
21define RULES
8e255b8b 22ifdef BUILD_SHARED
71c61f62
MR
23all: $(SUBDIR)$(SLIBNAME)
24
25install-libs: install-lib$(NAME)-shared
26
27$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
28 cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
29
e188cb70
RP
30$(SUBDIR)$(SLIB_EXTRA_OBJS): $(SLIB_EXTRA_DEP)
31
32$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)$(SLIB_EXTRA_OBJS)
71c61f62
MR
33 $(SLIB_CREATE_DEF_CMD)
34 $(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$^ $(FFEXTRALIBS) $(EXTRAOBJS)
35 $(SLIB_EXTRA_CMD)
36
8e255b8b 37ifdef SUBDIR
76ca42a8 38$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
71c61f62
MR
39endif
40endif
41
42install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
43 install -d "$(SHLIBDIR)"
44 install -m 755 $(SUBDIR)$(SLIBNAME) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
45 $(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
46 cd "$(SHLIBDIR)" && \
47 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
48 cd "$(SHLIBDIR)" && \
49 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
50 $(SLIB_INSTALL_EXTRA_CMD)
51
52install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
53 install -d "$(LIBDIR)"
54 install -m 644 $(SUBDIR)$(LIBNAME) "$(LIBDIR)"
55 $(LIB_INSTALL_EXTRA_CMD)
56
57install-headers::
58 install -d "$(INCINSTDIR)"
59 install -d "$(LIBDIR)/pkgconfig"
60 install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(INCINSTDIR)"
61 install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
62
63uninstall-libs::
64 -rm -f "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
65 "$(SHLIBDIR)/$(SLIBNAME)" \
66 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
67 -$(SLIB_UNINSTALL_EXTRA_CMD)
68 -rm -f "$(LIBDIR)/$(LIBNAME)"
69
70uninstall-headers::
71 rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
72 rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
73 -rmdir "$(INCDIR)"
74endef
75
76$(eval $(RULES))