lavfi: convert input/ouput list compound literals to named objects
[libav.git] / library.mak
CommitLineData
f038cf3c 1SRC_DIR := $(SRC_PATH)/lib$(NAME)
71c61f62 2
57b4a3dd 3include $(SRC_PATH)/common.mak
71c61f62
MR
4
5LIBVERSION := $(lib$(NAME)_VERSION)
6LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
477b3382
MR
7INCINSTDIR := $(INCDIR)/lib$(NAME)
8THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
71c61f62 9
451db983
MR
10all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
11all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
12
a854bcdb 13$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
659aa20e 14 $(COMPILE_C)
8c5239b3 15
a854bcdb 16$(SUBDIR)%-test.o: $(SUBDIR)%.c
659aa20e 17 $(COMPILE_C)
8c5239b3
MR
18
19$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
755834e9 20 $(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
8c5239b3
MR
21 $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
22
dfd9159f 23$(OBJS) $(SUBDIR)%.h.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
659aa20e 24$(TESTOBJS): CPPFLAGS += -DTEST
72c2bdeb 25
71c61f62 26$(SUBDIR)$(LIBNAME): $(OBJS)
50e10cbd 27 $(RM) $@
3dbc777c 28 $(AR) $(ARFLAGS) $(AR_O) $^ $(EXTRAOBJS)
71c61f62 29 $(RANLIB) $@
71c61f62 30
56540673
MR
31install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
32
451db983
MR
33install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
34install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
35
71c61f62 36define RULES
4b895cb2
MR
37$(EXAMPLES) $(TOOLS): LIB = $(FULLNAME:%=$(LD_LIB))
38$(TESTPROGS): LIB = $(SUBDIR)$(LIBNAME)
39
8a54bfe8 40$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
4b895cb2 41 $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(LIB) $(FFEXTRALIBS) $$(ELIBS)
3fd422ff 42
71c61f62 43$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
63611f31 44 $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
71c61f62 45
729f953f 46$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
71c61f62 47 $(SLIB_CREATE_DEF_CMD)
8f7c26e3 48 $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
71c61f62
MR
49 $(SLIB_EXTRA_CMD)
50
0c8cc2c4
MR
51clean::
52 $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
e7e19b15 53 $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(HOSTOBJS) $(HOSTPROGS)
0c8cc2c4
MR
54
55distclean:: clean
e7e19b15 56 $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
0c8cc2c4 57
71c61f62 58install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
63611f31 59 $(Q)mkdir -p "$(SHLIBDIR)"
2f138f0b
MR
60 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
61 $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
62 $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
63 $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
64 $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
63611f31 65
71c61f62 66install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
63611f31 67 $(Q)mkdir -p "$(LIBDIR)"
fd676deb 68 $$(INSTALL) -m 644 $$< "$(LIBDIR)"
6cfac0e9 69 $(LIB_INSTALL_EXTRA_CMD)
71c61f62 70
34512bca 71install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
63611f31 72 $(Q)mkdir -p "$(INCINSTDIR)"
34512bca
MR
73 $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
74
75install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
63611f31 76 $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
34512bca 77 $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
d3cb93b3
RP
78
79uninstall-libs::
50e10cbd 80 -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
d3cb93b3
RP
81 "$(SHLIBDIR)/$(SLIBNAME)" \
82 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
2f138f0b
MR
83 -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
84 -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
50e10cbd 85 -$(RM) "$(LIBDIR)/$(LIBNAME)"
d3cb93b3
RP
86
87uninstall-headers::
a2b4d1df 88 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
50e10cbd 89 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
a2b4d1df 90 -rmdir "$(INCINSTDIR)"
71c61f62
MR
91endef
92
93$(eval $(RULES))
3fd422ff 94
0fb3b24a
MR
95$(EXAMPLES) $(TOOLS): $(THIS_LIB) $(DEP_LIBS)
96$(TESTPROGS): $(SUBDIR)$(LIBNAME) $(DEP_LIBS)
bbba084b 97
3fd422ff
MR
98examples: $(EXAMPLES)
99testprogs: $(TESTPROGS)