2006-02-14 21:42:49 +00:00
|
|
|
#
|
|
|
|
# common bits used by all libraries
|
|
|
|
#
|
|
|
|
|
2008-04-07 22:25:13 +00:00
|
|
|
all: # make "all" default target
|
2008-03-10 19:43:07 +00:00
|
|
|
|
2008-04-08 17:06:25 +00:00
|
|
|
ifndef SUBDIR
|
2009-04-13 08:55:20 +00:00
|
|
|
vpath %.c $(SRC_DIR)
|
|
|
|
vpath %.h $(SRC_DIR)
|
|
|
|
vpath %.S $(SRC_DIR)
|
2008-11-08 09:51:12 +00:00
|
|
|
vpath %.asm $(SRC_DIR)
|
|
|
|
|
|
|
|
ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
|
|
|
|
BUILD_ROOT_REL = .
|
|
|
|
else
|
|
|
|
BUILD_ROOT_REL = ..
|
|
|
|
endif
|
2008-03-07 00:22:09 +00:00
|
|
|
|
|
|
|
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2009-09-24 10:09:14 +00:00
|
|
|
CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
|
2006-02-14 21:42:49 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
2009-09-24 10:09:14 +00:00
|
|
|
$(CCDEP)
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
|
2006-02-14 21:42:49 +00:00
|
|
|
|
|
|
|
%.o: %.S
|
2009-09-24 10:09:14 +00:00
|
|
|
$(ASDEP)
|
|
|
|
$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2007-10-18 10:09:24 +00:00
|
|
|
%.ho: %.h
|
2009-09-24 10:09:14 +00:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
|
2008-11-08 09:51:12 +00:00
|
|
|
|
2008-05-09 12:38:33 +00:00
|
|
|
%$(EXESUF): %.c
|
|
|
|
|
2008-11-08 09:51:12 +00:00
|
|
|
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
|
|
|
|
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
|
|
|
|
$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
|
|
|
|
endif
|
|
|
|
|
2009-04-13 08:55:20 +00:00
|
|
|
$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
|
2009-02-07 15:40:07 +00:00
|
|
|
$< $(SRC_PATH) $@ $(EXTRA_VERSION)
|
2008-11-08 09:51:12 +00:00
|
|
|
|
2008-04-07 22:25:13 +00:00
|
|
|
install: install-libs install-headers
|
2008-03-26 09:58:37 +00:00
|
|
|
|
2008-04-07 22:25:13 +00:00
|
|
|
uninstall: uninstall-libs uninstall-headers
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2009-04-13 08:55:20 +00:00
|
|
|
.PHONY: all depend dep *clean install* uninstall* examples testprogs
|
2008-04-07 22:25:13 +00:00
|
|
|
endif
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2009-04-13 08:55:20 +00:00
|
|
|
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
|
|
|
|
|
|
|
|
CFLAGS += $(CFLAGS-yes)
|
|
|
|
OBJS += $(OBJS-yes)
|
|
|
|
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
|
|
|
TESTPROGS += $(TESTPROGS-yes)
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2008-04-07 22:25:13 +00:00
|
|
|
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
|
2009-04-13 08:55:20 +00:00
|
|
|
FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2009-04-13 08:55:20 +00:00
|
|
|
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
|
|
|
|
OBJS := $(addprefix $(SUBDIR),$(OBJS))
|
|
|
|
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2009-09-24 10:09:14 +00:00
|
|
|
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
2008-04-13 10:54:33 +00:00
|
|
|
|
2009-02-07 15:40:07 +00:00
|
|
|
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
2009-09-24 10:09:14 +00:00
|
|
|
SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
|
|
|
|
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2008-04-13 10:54:33 +00:00
|
|
|
DEPS := $(OBJS:.o=.d)
|
|
|
|
depend dep: $(DEPS)
|
2006-02-14 21:42:49 +00:00
|
|
|
|
2009-09-24 10:09:14 +00:00
|
|
|
CLEANSUFFIXES = *.o *~ *.ho *.map
|
2008-11-08 09:51:12 +00:00
|
|
|
DISTCLEANSUFFIXES = *.d *.pc
|
2009-09-24 10:09:14 +00:00
|
|
|
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
|
2006-10-03 18:28:37 +00:00
|
|
|
|
2009-09-24 10:09:14 +00:00
|
|
|
-include $(wildcard $(DEPS))
|