2 # common bits used by all libraries
5 all: # make "all" default target
12 ifeq ($(SRC_DIR
),$(SRC_PATH_BARE
))
18 ALLFFLIBS
= avcodec avdevice avfilter avformat avutil postproc swscale
20 CFLAGS
:= -DHAVE_AV_CONFIG_H
-D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE \
21 -D_ISOC9X_SOURCE
-I
$(BUILD_ROOT_REL
) -I
$(SRC_PATH
) $(OPTFLAGS
)
24 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
27 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
30 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -Wno-unused
-c
-o
$@
-x c
$<
43 SVN_ENTRIES
= $(SRC_PATH_BARE
)/.svn
/entries
44 ifeq ($(wildcard $(SVN_ENTRIES
)),$(SVN_ENTRIES
))
45 $(BUILD_ROOT_REL
)/version.h
: $(SVN_ENTRIES
)
48 $(BUILD_ROOT_REL
)/version.h
:
49 $(SRC_PATH
)/version.sh
$(SRC_PATH
) $@
51 install: install-libs install-headers
53 uninstall: uninstall-libs uninstall-headers
55 .PHONY
: all depend dep
clean distclean install* uninstall* tests
58 CFLAGS
+= $(CFLAGS-yes
)
60 ASM_OBJS
+= $(ASM_OBJS-yes
)
61 CPP_OBJS
+= $(CPP_OBJS-yes
)
62 FFLIBS
:= $(FFLIBS-yes
) $(FFLIBS
)
65 FFEXTRALIBS
:= $(addprefix -l
,$(addsuffix $(BUILDSUF
),$(FFLIBS
))) $(EXTRALIBS
)
66 FFLDFLAGS
:= $(addprefix -L
$(BUILD_ROOT
)/lib
,$(FFLIBS
)) $(LDFLAGS
)
68 SRCS
:= $(OBJS
:.o
=.c
) $(ASM_OBJS
:.o
=.S
) $(CPP_OBJS
:.o
=.
cpp)
69 OBJS
:= $(OBJS
) $(ASM_OBJS
) $(CPP_OBJS
)
71 SRCS
:= $(addprefix $(SUBDIR
),$(SRCS
))
72 OBJS
:= $(addprefix $(SUBDIR
),$(OBJS
))
73 TESTS
:= $(addprefix $(SUBDIR
),$(TESTS
))
75 DEP_LIBS
:=$(foreach NAME
,$(FFLIBS
),lib
$(NAME
)/$($(BUILD_SHARED
:yes
=S
)LIBNAME
))
77 ALLHEADERS
:= $(subst $(SRC_DIR
)/,$(SUBDIR
),$(wildcard $(SRC_DIR
)/*.h
))
78 checkheaders
: $(filter-out %_template.ho
,$(ALLHEADERS
:.h
=.ho
))
83 CLEANSUFFIXES
= *.o
*~
*.ho
84 LIBSUFFIXES
= *.a
*.lib
*.so
*.so.
* *.dylib
*.dll
*.def
*.dll.a
*.exp
*.map
85 DISTCLEANSUFFIXES
= *.d
*.
pc
88 $(SUBDIR
)%$(EXESUF
): $(SUBDIR
)%.o
89 $(CC
) $(FFLDFLAGS
) -o
$$@
$$^
$(SUBDIR
)$(LIBNAME
) $(FFEXTRALIBS
)
91 $(SUBDIR
)%-test.o
: $(SUBDIR
)%.c
92 $(CC
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
94 $(SUBDIR
)%-test.o
: $(SUBDIR
)%-test.c
95 $(CC
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
98 rm -f
$(TESTS
) $(addprefix $(SUBDIR
),$(CLEANFILES
) $(CLEANSUFFIXES
) $(LIBSUFFIXES
)) \
99 $(addprefix $(SUBDIR
), $(foreach suffix,$(CLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))
102 rm -f
$(addprefix $(SUBDIR
),$(DISTCLEANSUFFIXES
)) \
103 $(addprefix $(SUBDIR
), $(foreach suffix,$(DISTCLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))