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