vf_drawtext: Remove some write-only variables.
[libav.git] / subdir.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
20 $(YASMDEP) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
21 $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
22
659aa20e
MR
23$(OBJS) $(SUBDIR)%.ho $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
24$(TESTOBJS): CPPFLAGS += -DTEST
72c2bdeb 25
71c61f62 26$(SUBDIR)$(LIBNAME): $(OBJS)
50e10cbd 27 $(RM) $@
71c61f62
MR
28 $(AR) rc $@ $^ $(EXTRAOBJS)
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
3fd422ff 37$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
63611f31 38 $$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
3fd422ff 39
71c61f62 40$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
63611f31 41 $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
71c61f62 42
729f953f 43$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
71c61f62 44 $(SLIB_CREATE_DEF_CMD)
63611f31 45 $$(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
71c61f62
MR
46 $(SLIB_EXTRA_CMD)
47
0c8cc2c4
MR
48clean::
49 $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
dc6632f1 50 $(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) \
0c8cc2c4
MR
51 $(HOSTOBJS) $(HOSTPROGS)
52
53distclean:: clean
dc6632f1
MR
54 $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) \
55 $(foreach dir,$(DIRS),$(DISTCLEANSUFFIXES:%=$(SUBDIR)$(dir)/%))
0c8cc2c4 56
71c61f62 57install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
63611f31 58 $(Q)mkdir -p "$(SHLIBDIR)"
fd676deb 59 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
63611f31 60 $(Q)cd "$(SHLIBDIR)" && \
71c61f62 61 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
63611f31 62 $(Q)cd "$(SHLIBDIR)" && \
71c61f62 63 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
bfca7777 64 $(SLIB_INSTALL_EXTRA_CMD)
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)"
83 -$(SLIB_UNINSTALL_EXTRA_CMD)
50e10cbd 84 -$(RM) "$(LIBDIR)/$(LIBNAME)"
d3cb93b3
RP
85
86uninstall-headers::
50e10cbd
MR
87 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS))
88 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
d3cb93b3 89 -rmdir "$(INCDIR)"
71c61f62
MR
90endef
91
92$(eval $(RULES))
3fd422ff 93
bbba084b
MR
94$(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS)
95
3fd422ff
MR
96examples: $(EXAMPLES)
97testprogs: $(TESTPROGS)