g2meet: validate bpp and bitmasks in the display info
[libav.git] / library.mak
CommitLineData
57b4a3dd 1include $(SRC_PATH)/common.mak
71c61f62
MR
2
3LIBVERSION := $(lib$(NAME)_VERSION)
4LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
304b806c 5LIBMINOR := $(lib$(NAME)_VERSION_MINOR)
477b3382 6INCINSTDIR := $(INCDIR)/lib$(NAME)
71c61f62 7
3a26ccbf 8LIB_EXAMPLES := $(LIB_EXAMPLES) $(EXAMPLES)
b3fab1f2
JG
9INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
10
451db983
MR
11all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
12all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
13
a854bcdb 14$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
659aa20e 15 $(COMPILE_C)
8c5239b3 16
a854bcdb 17$(SUBDIR)%-test.o: $(SUBDIR)%.c
659aa20e 18 $(COMPILE_C)
8c5239b3 19
c2626492
MR
20$(SUBDIR)%-test.i: $(SUBDIR)%-test.c
21 $(CC) $(CCFLAGS) $(CC_E) $<
22
23$(SUBDIR)%-test.i: $(SUBDIR)%.c
24 $(CC) $(CCFLAGS) $(CC_E) $<
25
8c5239b3 26$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
755834e9 27 $(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
8c5239b3 28 $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
0673ede9 29 -$(STRIP) $(STRIPFLAGS) $@
8c5239b3 30
c2626492
MR
31LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
32$(LIBOBJS) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
33$(TESTOBJS) $(TESTOBJS:.o=.i): CPPFLAGS += -DTEST
72c2bdeb 34
71c61f62 35$(SUBDIR)$(LIBNAME): $(OBJS)
50e10cbd 36 $(RM) $@
4436f25a 37 $(AR) $(ARFLAGS) $(AR_O) $^
71c61f62 38 $(RANLIB) $@
71c61f62 39
56540673
MR
40install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
41
451db983
MR
42install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
43install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
44
71c61f62 45define RULES
effe4438
MR
46$(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
47$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
4b895cb2 48
80521c19 49$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
effe4438 50 $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
3fd422ff 51
71c61f62 52$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
63611f31 53 $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
71c61f62 54
729f953f 55$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
71c61f62 56 $(SLIB_CREATE_DEF_CMD)
4436f25a 57 $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
71c61f62
MR
58 $(SLIB_EXTRA_CMD)
59
0c8cc2c4
MR
60clean::
61 $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
395c3feb 62 $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
0c8cc2c4
MR
63
64distclean:: clean
e7e19b15 65 $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
0c8cc2c4 66
71c61f62 67install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
63611f31 68 $(Q)mkdir -p "$(SHLIBDIR)"
2f138f0b
MR
69 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
70 $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
71 $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
72 $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
73 $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
63611f31 74
71c61f62 75install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
63611f31 76 $(Q)mkdir -p "$(LIBDIR)"
fd676deb 77 $$(INSTALL) -m 644 $$< "$(LIBDIR)"
6cfac0e9 78 $(LIB_INSTALL_EXTRA_CMD)
71c61f62 79
34512bca 80install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
63611f31 81 $(Q)mkdir -p "$(INCINSTDIR)"
34512bca
MR
82 $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
83
84install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
63611f31 85 $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
34512bca 86 $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
d3cb93b3
RP
87
88uninstall-libs::
50e10cbd 89 -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
d3cb93b3
RP
90 "$(SHLIBDIR)/$(SLIBNAME)" \
91 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
2f138f0b
MR
92 -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
93 -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
50e10cbd 94 -$(RM) "$(LIBDIR)/$(LIBNAME)"
d3cb93b3
RP
95
96uninstall-headers::
a2b4d1df 97 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
50e10cbd 98 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
a2b4d1df 99 -rmdir "$(INCINSTDIR)"
71c61f62
MR
100endef
101
102$(eval $(RULES))
3fd422ff 103
e5c6e9a6 104$(EXAMPLES) $(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
1c7428e6 105$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
bbba084b 106
3fd422ff
MR
107examples: $(EXAMPLES)
108testprogs: $(TESTPROGS)