2 # common bits used by all libraries
5 all: # make "all" default target
11 vpath
%.asm
$(SRC_DIR
)
13 ifeq ($(SRC_DIR
),$(SRC_PATH_BARE
))
19 ALLFFLIBS
= avcodec avdevice avfilter avformat avutil postproc swscale
21 CFLAGS
:= -DHAVE_AV_CONFIG_H
-D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE \
22 -I
$(BUILD_ROOT_REL
) -I
$(SRC_PATH
) -I
$(SRC_PATH
)/ffmpeg
$(OPTFLAGS
)
25 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
-MD
-MP
-MF
$*.d
$<
28 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
-MD
-MP
-MF
$*.d
$<
31 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -Wno-unused
-c
-o
$@
-x c
$<
35 SVN_ENTRIES
= $(SRC_PATH_BARE
)/.svn
/entries
36 ifeq ($(wildcard $(SVN_ENTRIES
)),$(SVN_ENTRIES
))
37 $(BUILD_ROOT_REL
)/version.h
: $(SVN_ENTRIES
)
40 $(BUILD_ROOT_REL
)/version.h
: $(SRC_PATH_BARE
)/version.sh
41 $< $(SRC_PATH
) $@
$(EXTRA_VERSION
)
43 install: install-libs install-headers
45 uninstall: uninstall-libs uninstall-headers
47 .PHONY
: all depend dep
clean distclean install* uninstall* tests
50 CFLAGS
+= $(CFLAGS-yes
)
52 FFLIBS
:= $(FFLIBS-yes
) $(FFLIBS
)
55 FFEXTRALIBS
:= $(addprefix -l
,$(addsuffix $(BUILDSUF
),$(FFLIBS
))) $(EXTRALIBS
)
56 FFLDFLAGS
:= $(addprefix -L
$(BUILD_ROOT
)/lib
,$(FFLIBS
)) $(LDFLAGS
)
58 OBJS
:= $(addprefix $(SUBDIR
),$(OBJS
))
59 TESTS
:= $(addprefix $(SUBDIR
),$(TESTS
))
61 DEP_LIBS
:=$(foreach NAME
,$(FFLIBS
),lib
$(NAME
)/$($(BUILD_SHARED
:yes
=S
)LIBNAME
))
63 ALLHEADERS
:= $(subst $(SRC_DIR
)/,$(SUBDIR
),$(wildcard $(SRC_DIR
)/*.h
$(SRC_DIR
)/$(ARCH
)/*.h
))
64 checkheaders
: $(filter-out %_template.ho
,$(ALLHEADERS
:.h
=.ho
))
69 CLEANSUFFIXES
= *.o
*~
*.ho
70 LIBSUFFIXES
= *.a
*.lib
*.so
*.so.
* *.dylib
*.dll
*.def
*.dll.a
*.exp
*.map
71 DISTCLEANSUFFIXES
= *.d
*.
pc
74 $(SUBDIR
)%$(EXESUF
): $(SUBDIR
)%.o
75 $(CC
) $(FFLDFLAGS
) -o
$$@
$$^
$(SUBDIR
)$(LIBNAME
) $(FFEXTRALIBS
)
77 $(SUBDIR
)%-test.o
: $(SUBDIR
)%.c
78 $(CC
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
80 $(SUBDIR
)%-test.o
: $(SUBDIR
)%-test.c
81 $(CC
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
83 $(SUBDIR
)x86
/%.o
: $(SUBDIR
)x86
/%.asm
84 $(YASM
) $(YASMFLAGS
) -I
$$(<D
)/ -o
$$@
$$<
85 $(YASM
) $(YASMFLAGS
) -I
$$(<D
)/ -M
-o
$$@
$$< > $$(@
:%.o
=%.d
)
88 rm -f
$(TESTS
) $(addprefix $(SUBDIR
),$(CLEANFILES
) $(CLEANSUFFIXES
) $(LIBSUFFIXES
)) \
89 $(addprefix $(SUBDIR
), $(foreach suffix,$(CLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))
92 rm -f
$(addprefix $(SUBDIR
),$(DISTCLEANSUFFIXES
)) \
93 $(addprefix $(SUBDIR
), $(foreach suffix,$(DISTCLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))