2 # common bits used by all libraries
5 SRC_DIR = $(SRC_PATH)/lib$(NAME)
8 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
9 OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
10 STATIC_OBJS := $(OBJS) $(STATIC_OBJS)
11 SHARED_OBJS := $(OBJS) $(SHARED_OBJS)
13 EXTRALIBS := -L$(BUILD_ROOT)/libavutil -lavutil$(BUILDSUF) $(EXTRALIBS)
15 all: $(EXTRADEPS) $(LIB) $(SLIBNAME)
17 $(LIB): $(STATIC_OBJS)
19 $(AR) rc $@ $^ $(EXTRAOBJS)
22 $(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
25 $(SLIBNAME_WITH_MAJOR): $(SHARED_OBJS)
26 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
30 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
33 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
35 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
37 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
40 $(CC) $(LDFLAGS) -o $@ $^ $(EXTRALIBS)
43 $(CC) -MM $(CFLAGS) $^ 1>.depend
46 rm -f *.o *.d *~ *.a *.lib *.so *.so.* *.dylib *.dll \
47 *.lib *.def *.dll.a *.exp
52 ifeq ($(BUILD_SHARED),yes)
53 INSTLIBTARGETS += install-lib-shared
55 ifeq ($(BUILD_STATIC),yes)
56 INSTLIBTARGETS += install-lib-static
59 install: install-libs install-headers
61 install-libs: $(INSTLIBTARGETS)
63 install-lib-shared: $(SLIBNAME)
64 install -d "$(shlibdir)"
65 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
66 "$(shlibdir)/$(SLIBNAME_WITH_VERSION)"
68 ln -sf $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
70 ln -sf $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
72 install-lib-static: $(LIB)
73 install -d "$(libdir)"
74 install -m 644 $(LIB) "$(libdir)"
75 $(LIB_INSTALL_EXTRA_CMD)
78 install -d "$(incdir)"
79 install -d "$(libdir)/pkgconfig"
80 install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(incdir)"
81 install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(libdir)/pkgconfig"
83 uninstall: uninstall-libs uninstall-headers
86 -rm -f "$(shlibdir)/$(SLIBNAME_WITH_MAJOR)" \
87 "$(shlibdir)/$(SLIBNAME)" \
88 "$(shlibdir)/$(SLIBNAME_WITH_VERSION)"
89 -rm -f "$(libdir)/$(LIB)"
92 rm -f $(addprefix "$(incdir)/",$(HEADERS))
93 rm -f "$(libdir)/pkgconfig/lib$(NAME).pc"
95 .PHONY: all depend dep clean distclean install* uninstall*
98 # include dependency files if they exist
100 ifneq ($(wildcard .depend),)