Remove explicit filename from Doxygen @file commands.
[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)
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
8c5239b3
MR
13$(SUBDIR)%-test.o: $(SUBDIR)%.c
14 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c $(CC_O) $^
15
16$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
17 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c $(CC_O) $^
18
19$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
20 $(YASMDEP) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
21 $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
22
2a5500b1 23$(OBJS) $(SUBDIR)%.ho $(SUBDIR)%-test.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
72c2bdeb 24
71c61f62 25$(SUBDIR)$(LIBNAME): $(OBJS)
50e10cbd 26 $(RM) $@
71c61f62
MR
27 $(AR) rc $@ $^ $(EXTRAOBJS)
28 $(RANLIB) $@
71c61f62 29
56540673
MR
30install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
31
451db983
MR
32install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
33install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
34
71c61f62 35define RULES
3fd422ff 36$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
63611f31 37 $$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
3fd422ff 38
71c61f62 39$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
63611f31 40 $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
71c61f62 41
a482e61b 42$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
71c61f62 43 $(SLIB_CREATE_DEF_CMD)
63611f31 44 $$(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
71c61f62
MR
45 $(SLIB_EXTRA_CMD)
46
8e255b8b 47ifdef SUBDIR
76ca42a8 48$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
71c61f62 49endif
71c61f62 50
0c8cc2c4
MR
51clean::
52 $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
53 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) \
54 $(HOSTOBJS) $(HOSTPROGS)
55
56distclean:: clean
57 $(RM) $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
58 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
59
71c61f62 60install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
63611f31 61 $(Q)mkdir -p "$(SHLIBDIR)"
fd676deb 62 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
63611f31
MR
63 $$(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
64 $(Q)cd "$(SHLIBDIR)" && \
71c61f62 65 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
63611f31 66 $(Q)cd "$(SHLIBDIR)" && \
71c61f62 67 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
bfca7777 68 $(SLIB_INSTALL_EXTRA_CMD)
63611f31 69
71c61f62 70install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
63611f31 71 $(Q)mkdir -p "$(LIBDIR)"
fd676deb 72 $$(INSTALL) -m 644 $$< "$(LIBDIR)"
6cfac0e9 73 $(LIB_INSTALL_EXTRA_CMD)
71c61f62 74
34512bca 75install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
63611f31 76 $(Q)mkdir -p "$(INCINSTDIR)"
34512bca
MR
77 $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
78
79install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
63611f31 80 $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
34512bca 81 $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
d3cb93b3
RP
82
83uninstall-libs::
50e10cbd 84 -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
d3cb93b3
RP
85 "$(SHLIBDIR)/$(SLIBNAME)" \
86 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
87 -$(SLIB_UNINSTALL_EXTRA_CMD)
50e10cbd 88 -$(RM) "$(LIBDIR)/$(LIBNAME)"
d3cb93b3
RP
89
90uninstall-headers::
50e10cbd
MR
91 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS))
92 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
d3cb93b3 93 -rmdir "$(INCDIR)"
71c61f62
MR
94endef
95
96$(eval $(RULES))
3fd422ff 97
bbba084b
MR
98$(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS)
99
3fd422ff
MR
100examples: $(EXAMPLES)
101testprogs: $(TESTPROGS)