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
-I
$(BUILD_ROOT_REL
) -I
$(SRC_PATH
) $(OPTFLAGS
)
24 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
27 $(AS
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
30 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -Wno-unused
-c
-o
$@
-x c
$<
45 SVN_ENTRIES
= $(SRC_PATH_BARE
)/.svn
/entries
46 ifeq ($(wildcard $(SVN_ENTRIES
)),$(SVN_ENTRIES
))
47 $(BUILD_ROOT_REL
)/version.h
: $(SVN_ENTRIES
)
50 $(BUILD_ROOT_REL
)/version.h
: $(SRC_PATH_BARE
)/version.sh config.mak
51 $< $(SRC_PATH
) $@
$(EXTRA_VERSION
)
53 install: install-libs install-headers
55 uninstall: uninstall-libs uninstall-headers
57 .PHONY
: all depend dep
clean distclean install* uninstall* tests
60 CFLAGS
+= $(CFLAGS-yes
)
62 FFLIBS
:= $(FFLIBS-yes
) $(FFLIBS
)
65 FFEXTRALIBS
:= $(addprefix -l
,$(addsuffix $(BUILDSUF
),$(FFLIBS
))) $(EXTRALIBS
)
66 FFLDFLAGS
:= $(addprefix -L
$(BUILD_ROOT
)/lib
,$(FFLIBS
)) $(LDFLAGS
)
68 OBJS
:= $(addprefix $(SUBDIR
),$(OBJS
))
69 TESTS
:= $(addprefix $(SUBDIR
),$(TESTS
))
71 DEP_LIBS
:=$(foreach NAME
,$(FFLIBS
),lib
$(NAME
)/$($(BUILD_SHARED
:yes
=S
)LIBNAME
))
73 ALLHEADERS
:= $(subst $(SRC_DIR
)/,$(SUBDIR
),$(wildcard $(SRC_DIR
)/*.h
$(SRC_DIR
)/$(ARCH
)/*.h
))
74 checkheaders
: $(filter-out %_template.ho
,$(ALLHEADERS
:.h
=.ho
))
79 CLEANSUFFIXES
= *.o
*~
*.ho
80 LIBSUFFIXES
= *.a
*.lib
*.so
*.so.
* *.dylib
*.dll
*.def
*.dll.a
*.exp
*.map
81 DISTCLEANSUFFIXES
= *.d
*.
pc
84 $(SUBDIR
)%$(EXESUF
): $(SUBDIR
)%.o
85 $(CC
) $(FFLDFLAGS
) -o
$$@
$$^
$(SUBDIR
)$(LIBNAME
) $(FFEXTRALIBS
)
87 $(SUBDIR
)%-test.o
: $(SUBDIR
)%.c
88 $(CC
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
90 $(SUBDIR
)%-test.o
: $(SUBDIR
)%-test.c
91 $(CC
) $(CFLAGS
) -DTEST
-c
-o
$$@
$$^
93 $(SUBDIR
)x86
/%.o
: $(SUBDIR
)x86
/%.asm
94 $(YASM
) $(YASMFLAGS
) -I
$$(<D
)/ -o
$$@
$$<
96 $(SUBDIR
)x86
/%.d
: $(SUBDIR
)x86
/%.asm
97 $(YASM
) $(YASMFLAGS
) -I
$$(<D
)/ -M
-o
$$(@
:%.d
=%.o
) $$< > $$@
100 rm -f
$(TESTS
) $(addprefix $(SUBDIR
),$(CLEANFILES
) $(CLEANSUFFIXES
) $(LIBSUFFIXES
)) \
101 $(addprefix $(SUBDIR
), $(foreach suffix,$(CLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))
104 rm -f
$(addprefix $(SUBDIR
),$(DISTCLEANSUFFIXES
)) \
105 $(addprefix $(SUBDIR
), $(foreach suffix,$(DISTCLEANSUFFIXES
),$(addsuffix /$(suffix),$(DIRS
))))