comparison subdir.mak @ 31273:0f9c3f446fc6

Update common.mak and subdir.mak to latest FFmpeg versions.
author reimar
date Sun, 06 Jun 2010 15:41:37 +0000
parents bc094de7968e
children
comparison
equal deleted inserted replaced
31272:e340fa125680 31273:0f9c3f446fc6
2 2
3 include $(SUBDIR)../common.mak 3 include $(SUBDIR)../common.mak
4 4
5 LIBVERSION := $(lib$(NAME)_VERSION) 5 LIBVERSION := $(lib$(NAME)_VERSION)
6 LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) 6 LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
7 INCINSTDIR := $(INCDIR)/lib$(NAME)
8 THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
7 9
8 ifeq ($(CONFIG_STATIC),yes) 10 all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
9 all: $(SUBDIR)$(LIBNAME) 11 all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
10 12
11 install-libs: install-lib$(NAME)-static 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
23 $(OBJS) $(SUBDIR)%.ho $(SUBDIR)%-test.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
12 24
13 $(SUBDIR)$(LIBNAME): $(OBJS) 25 $(SUBDIR)$(LIBNAME): $(OBJS)
14 rm -f $@ 26 $(RM) $@
15 $(AR) rc $@ $^ $(EXTRAOBJS) 27 $(AR) rc $@ $^ $(EXTRAOBJS)
16 $(RANLIB) $@ 28 $(RANLIB) $@
17 endif
18 29
19 INCINSTDIR := $(INCDIR)/lib$(NAME) 30 install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
20 31
21 THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) 32 install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
33 install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
22 34
23 define RULES 35 define RULES
24 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o 36 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
25 $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) 37 $$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
26
27 $(SUBDIR)%-test.o: $(SUBDIR)%.c
28 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
29
30 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
31 $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^
32
33 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
34 $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:.o=.d)
35 $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
36
37 clean::
38 rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
39 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
40
41 distclean:: clean
42 rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
43 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
44
45 ifdef CONFIG_SHARED
46 all: $(SUBDIR)$(SLIBNAME)
47
48 install-libs: install-lib$(NAME)-shared
49 38
50 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) 39 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
51 cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) 40 $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
52 41
53 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) 42 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
54 $(SLIB_CREATE_DEF_CMD) 43 $(SLIB_CREATE_DEF_CMD)
55 $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) 44 $$(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
56 $(SLIB_EXTRA_CMD) 45 $(SLIB_EXTRA_CMD)
57 46
58 ifdef SUBDIR 47 ifdef SUBDIR
59 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS) 48 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
60 endif 49 endif
61 endif 50
51 clean::
52 $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
53 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) \
54 $(HOSTOBJS) $(HOSTPROGS)
55
56 distclean:: clean
57 $(RM) $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
58 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
62 59
63 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME) 60 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
64 install -d "$(SHLIBDIR)" 61 $(Q)mkdir -p "$(SHLIBDIR)"
65 install -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" 62 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
66 $(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" 63 $$(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
67 cd "$(SHLIBDIR)" && \ 64 $(Q)cd "$(SHLIBDIR)" && \
68 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR) 65 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
69 cd "$(SHLIBDIR)" && \ 66 $(Q)cd "$(SHLIBDIR)" && \
70 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME) 67 $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME)
71 $(SLIB_INSTALL_EXTRA_CMD) 68 $(SLIB_INSTALL_EXTRA_CMD)
72 69
73 install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME) 70 install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
74 install -d "$(LIBDIR)" 71 $(Q)mkdir -p "$(LIBDIR)"
75 install -m 644 $$< "$(LIBDIR)" 72 $$(INSTALL) -m 644 $$< "$(LIBDIR)"
76 $(LIB_INSTALL_EXTRA_CMD) 73 $(LIB_INSTALL_EXTRA_CMD)
77 74
78 install-headers:: 75 install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
79 install -d "$(INCINSTDIR)" 76 $(Q)mkdir -p "$(INCINSTDIR)"
80 install -d "$(LIBDIR)/pkgconfig" 77 $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
81 install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(INCINSTDIR)" 78
82 install -m 644 $(BUILD_ROOT)/lib$(NAME)/lib$(NAME).pc "$(LIBDIR)/pkgconfig" 79 install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
80 $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
81 $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
83 82
84 uninstall-libs:: 83 uninstall-libs::
85 -rm -f "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \ 84 -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
86 "$(SHLIBDIR)/$(SLIBNAME)" \ 85 "$(SHLIBDIR)/$(SLIBNAME)" \
87 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" 86 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
88 -$(SLIB_UNINSTALL_EXTRA_CMD) 87 -$(SLIB_UNINSTALL_EXTRA_CMD)
89 -rm -f "$(LIBDIR)/$(LIBNAME)" 88 -$(RM) "$(LIBDIR)/$(LIBNAME)"
90 89
91 uninstall-headers:: 90 uninstall-headers::
92 rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS)) 91 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS))
93 rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc" 92 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
94 -rmdir "$(INCDIR)" 93 -rmdir "$(INCDIR)"
95 endef 94 endef
96 95
97 $(eval $(RULES)) 96 $(eval $(RULES))
98 97