Remove unused file
[libav.git] / common.mak
CommitLineData
8b2121e3
MR
1#
2# common bits used by all libraries
3#
4
997baf01
MR
5VPATH = $(SRC_PATH_BARE)/lib$(NAME)
6SRC_DIR = "$(VPATH)"
8b2121e3 7
722dabcc
DB
8CFLAGS += $(CFLAGS-yes)
9OBJS += $(OBJS-yes)
10ASM_OBJS += $(ASM_OBJS-yes)
2d93bcc7 11CPP_OBJS += $(CPP_OBJS-yes)
722dabcc 12
dadb850a
DB
13CFLAGS += -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
14 -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) \
15 -I$(SRC_PATH)/libavutil $(OPTFLAGS)
1963f5e3 16
1540cfdc 17SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
8b2121e3
MR
18OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
19STATIC_OBJS := $(OBJS) $(STATIC_OBJS)
20SHARED_OBJS := $(OBJS) $(SHARED_OBJS)
21
06aa32ff 22all: $(EXTRADEPS) $(LIB) $(SLIBNAME)
8b2121e3
MR
23
24$(LIB): $(STATIC_OBJS)
25 rm -f $@
26 $(AR) rc $@ $^ $(EXTRAOBJS)
27 $(RANLIB) $@
28
baa3a937
MR
29$(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
30 ln -sf $^ $@
31
32$(SLIBNAME_WITH_MAJOR): $(SHARED_OBJS)
8b2121e3 33 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
5cb854e1 34 $(SLIB_EXTRA_CMD)
8b2121e3
MR
35
36%.o: %.c
37 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
38
39%.o: %.S
40 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
41
c6c46511
DB
42%: %.o $(LIB)
43 $(CC) $(LDFLAGS) -o $@ $^ $(EXTRALIBS)
44
e4d86a57
MR
45%.ho: %.h
46 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
47
48ALLHEADERS = $(subst $(VPATH)/,,$(wildcard $(VPATH)/*.h))
49checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
50
9d0199f4 51depend dep: $(SRCS)
8b2121e3
MR
52 $(CC) -MM $(CFLAGS) $^ 1>.depend
53
8b2121e3 54clean::
b8d40825 55 rm -f *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
e4d86a57 56 *.def *.dll.a *.exp *.ho
8b2121e3
MR
57
58distclean: clean
59 rm -f .depend
60
61ifeq ($(BUILD_SHARED),yes)
62INSTLIBTARGETS += install-lib-shared
63endif
64ifeq ($(BUILD_STATIC),yes)
65INSTLIBTARGETS += install-lib-static
66endif
67
68install: install-libs install-headers
69
70install-libs: $(INSTLIBTARGETS)
71
72install-lib-shared: $(SLIBNAME)
b8e10478 73 install -d "$(shlibdir)"
ca3798dc
RP
74 install -m 755 $(SLIBNAME) "$(shlibdir)/$(SLIBNAME_WITH_VERSION)"
75 $(STRIP) "$(shlibdir)/$(SLIBNAME_WITH_VERSION)"
e35a3b7d
DB
76 cd "$(shlibdir)" && \
77 ln -sf $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
78 cd "$(shlibdir)" && \
79 ln -sf $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
8fbec4f4 80 $(SLIB_INSTALL_EXTRA_CMD)
8b2121e3
MR
81
82install-lib-static: $(LIB)
c7bb67c4 83 install -d "$(libdir)"
8b2121e3 84 install -m 644 $(LIB) "$(libdir)"
d7e27559 85 $(LIB_INSTALL_EXTRA_CMD)
8b2121e3
MR
86
87install-headers:
c7bb67c4
MR
88 install -d "$(incdir)"
89 install -d "$(libdir)/pkgconfig"
997baf01 90 install -m 644 $(addprefix $(SRC_DIR)/,$(HEADERS)) "$(incdir)"
8b2121e3
MR
91 install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(libdir)/pkgconfig"
92
f9edb717
DB
93uninstall: uninstall-libs uninstall-headers
94
95uninstall-libs:
afa61532
DB
96 -rm -f "$(shlibdir)/$(SLIBNAME_WITH_MAJOR)" \
97 "$(shlibdir)/$(SLIBNAME)" \
98 "$(shlibdir)/$(SLIBNAME_WITH_VERSION)"
afa61532 99 -rm -f "$(libdir)/$(LIB)"
f9edb717 100
fa62bdb8 101uninstall-headers::
76808d6e 102 rm -f $(addprefix "$(incdir)/",$(HEADERS))
afa61532 103 rm -f "$(libdir)/pkgconfig/lib$(NAME).pc"
f9edb717 104
3263626f
DB
105.PHONY: all depend dep clean distclean install* uninstall*
106
6ca0c110 107-include .depend