TwinVQ decoder
[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
bea81a52 8ifeq ($(CONFIG_STATIC),yes)
71c61f62
MR
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
bea81a52 21THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
bbba084b 22
71c61f62 23define RULES
3fd422ff 24$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
684b28e0 25 $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
3fd422ff
MR
26
27$(SUBDIR)%-test.o: $(SUBDIR)%.c
b0f0c430 28 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
3fd422ff
MR
29
30$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
b0f0c430 31 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
3fd422ff
MR
32
33$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
34 $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
35
36$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
37 $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
38
39clean::
9292bd77 40 rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
3fd422ff
MR
41 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
42
43distclean:: clean
44 rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
45 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
46
bea81a52 47ifdef CONFIG_SHARED
71c61f62
MR
48all: $(SUBDIR)$(SLIBNAME)
49
50install-libs: install-lib$(NAME)-shared
51
52$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
53 cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
54
0147b92e 55$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS)
71c61f62 56 $(SLIB_CREATE_DEF_CMD)
684b28e0 57 $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
71c61f62
MR
58 $(SLIB_EXTRA_CMD)
59
8e255b8b 60ifdef SUBDIR
76ca42a8 61$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
71c61f62
MR
62endif
63endif
64
65install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
66 install -d "$(SHLIBDIR)"
3c3e0680 67 install -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
71c61f62
MR
68 $(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
69 cd "$(SHLIBDIR)" && \
70 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
71 cd "$(SHLIBDIR)" && \
72 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
73 $(SLIB_INSTALL_EXTRA_CMD)
74
75install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
76 install -d "$(LIBDIR)"
3c3e0680 77 install -m 644 $$< "$(LIBDIR)"
71c61f62
MR
78 $(LIB_INSTALL_EXTRA_CMD)
79
80install-headers::
81 install -d "$(INCINSTDIR)"
82 install -d "$(LIBDIR)/pkgconfig"
83 install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(INCINSTDIR)"
25cd5cb3 84 install -m 644 $(BUILD_ROOT)/lib$(NAME)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
71c61f62
MR
85
86uninstall-libs::
87 -rm -f "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
88 "$(SHLIBDIR)/$(SLIBNAME)" \
89 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
90 -$(SLIB_UNINSTALL_EXTRA_CMD)
91 -rm -f "$(LIBDIR)/$(LIBNAME)"
92
93uninstall-headers::
94 rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
95 rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
96 -rmdir "$(INCDIR)"
97endef
98
99$(eval $(RULES))
3fd422ff 100
bbba084b
MR
101$(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS)
102
3fd422ff
MR
103examples: $(EXAMPLES)
104testprogs: $(TESTPROGS)