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