do not reset duration_error for all streams, only reset current stream, fix wrong_fps.gxf
[libav.git] / common.mak
CommitLineData
8b2121e3
MR
1#
2# common bits used by all libraries
3#
4
de2f77d8
MR
5LIBSRC = $(SRC_PATH_BARE)/lib$(NAME)
6
7vpath %.c $(LIBSRC)
8vpath %.h $(LIBSRC)
9vpath %.S $(LIBSRC)
10
11SRC_DIR = "$(LIBSRC)"
8b2121e3 12
722dabcc
DB
13CFLAGS += $(CFLAGS-yes)
14OBJS += $(OBJS-yes)
15ASM_OBJS += $(ASM_OBJS-yes)
2d93bcc7 16CPP_OBJS += $(CPP_OBJS-yes)
722dabcc 17
dadb850a
DB
18CFLAGS += -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
19 -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) \
20 -I$(SRC_PATH)/libavutil $(OPTFLAGS)
1963f5e3 21
1540cfdc 22SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
8b2121e3 23OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
8b2121e3 24
24743a76 25all: $(LIBNAME) $(SLIBNAME)
8b2121e3 26
582c1c47 27$(LIBNAME): $(OBJS)
8b2121e3
MR
28 rm -f $@
29 $(AR) rc $@ $^ $(EXTRAOBJS)
30 $(RANLIB) $@
31
baa3a937 32$(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
20369773 33 $(LN_S) $^ $@
baa3a937 34
582c1c47 35$(SLIBNAME_WITH_MAJOR): $(OBJS)
d22e8442 36 $(SLIB_CREATE_DEF_CMD)
8b2121e3 37 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
5cb854e1 38 $(SLIB_EXTRA_CMD)
8b2121e3
MR
39
40%.o: %.c
41 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
42
43%.o: %.S
44 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
45
24743a76 46%: %.o $(LIBNAME)
c6c46511
DB
47 $(CC) $(LDFLAGS) -o $@ $^ $(EXTRALIBS)
48
e4d86a57
MR
49%.ho: %.h
50 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
51
de2f77d8 52ALLHEADERS = $(subst $(LIBSRC)/,,$(wildcard $(LIBSRC)/*.h))
e4d86a57
MR
53checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
54
9d0199f4 55depend dep: $(SRCS)
8b2121e3
MR
56 $(CC) -MM $(CFLAGS) $^ 1>.depend
57
8b2121e3 58clean::
b8d40825 59 rm -f *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
bca9e0bc 60 *.def *.dll.a *.exp *.ho *.map $(TESTS)
8b2121e3
MR
61
62distclean: clean
63 rm -f .depend
64
71fa13e8
DB
65INSTALL_TARGETS-$(BUILD_SHARED) += install-lib-shared
66INSTALL_TARGETS-$(BUILD_STATIC) += install-lib-static
8b2121e3
MR
67
68install: install-libs install-headers
69
71fa13e8 70install-libs: $(INSTALL_TARGETS-yes)
8b2121e3
MR
71
72install-lib-shared: $(SLIBNAME)
22a324da
DB
73 install -d "$(SHLIBDIR)"
74 install -m 755 $(SLIBNAME) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
75 $(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
76 cd "$(SHLIBDIR)" && \
20369773 77 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
22a324da 78 cd "$(SHLIBDIR)" && \
20369773 79 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
8fbec4f4 80 $(SLIB_INSTALL_EXTRA_CMD)
8b2121e3 81
24743a76 82install-lib-static: $(LIBNAME)
22a324da 83 install -d "$(LIBDIR)"
24743a76 84 install -m 644 $(LIBNAME) "$(LIBDIR)"
d7e27559 85 $(LIB_INSTALL_EXTRA_CMD)
8b2121e3 86
76a448ed
MR
87INCINSTDIR = $(INCDIR)/lib$(NAME)
88
8b2121e3 89install-headers:
76a448ed 90 install -d "$(INCINSTDIR)"
22a324da 91 install -d "$(LIBDIR)/pkgconfig"
76a448ed 92 install -m 644 $(addprefix $(SRC_DIR)/,$(HEADERS)) "$(INCINSTDIR)"
22a324da 93 install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
8b2121e3 94
f9edb717
DB
95uninstall: uninstall-libs uninstall-headers
96
97uninstall-libs:
22a324da
DB
98 -rm -f "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
99 "$(SHLIBDIR)/$(SLIBNAME)" \
100 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
5b5d0491 101 -$(SLIB_UNINSTALL_EXTRA_CMD)
24743a76 102 -rm -f "$(LIBDIR)/$(LIBNAME)"
f9edb717 103
fa62bdb8 104uninstall-headers::
76a448ed 105 rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
22a324da 106 rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
f9edb717 107
bca9e0bc
DB
108tests: $(TESTS)
109
110%-test$(EXESUF): %.c $(LIBNAME)
111 $(CC) $(CFLAGS) $(LDFLAGS) -DTEST -o $@ $^ $(EXTRALIBS)
112
113.PHONY: all depend dep clean distclean install* uninstall* tests
3263626f 114
6ca0c110 115-include .depend