2006-02-13 12:53:25 +00:00
|
|
|
#
|
|
|
|
# common bits used by all libraries
|
|
|
|
#
|
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
all: # make "all" default target
|
2008-03-07 19:27:17 +00:00
|
|
|
|
2008-04-07 22:17:47 +00:00
|
|
|
ifndef SUBDIR
|
2009-03-25 18:14:28 +00:00
|
|
|
vpath %.c $(SRC_DIR)
|
|
|
|
vpath %.h $(SRC_DIR)
|
|
|
|
vpath %.S $(SRC_DIR)
|
2008-08-11 23:53:31 +00:00
|
|
|
vpath %.asm $(SRC_DIR)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2008-06-19 16:57:38 +00:00
|
|
|
ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
|
|
|
|
BUILD_ROOT_REL = .
|
|
|
|
else
|
|
|
|
BUILD_ROOT_REL = ..
|
|
|
|
endif
|
|
|
|
|
2008-03-06 20:44:44 +00:00
|
|
|
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
|
|
|
|
2009-03-03 12:52:12 +00:00
|
|
|
CFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.S
|
2009-03-05 21:20:01 +00:00
|
|
|
$(AS) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2007-06-17 00:05:39 +00:00
|
|
|
%.ho: %.h
|
|
|
|
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
|
|
|
|
|
2008-04-09 20:48:17 +00:00
|
|
|
%.d: %.c
|
|
|
|
$(DEPEND_CMD) > $@
|
|
|
|
|
|
|
|
%.d: %.S
|
|
|
|
$(DEPEND_CMD) > $@
|
|
|
|
|
|
|
|
%.d: %.cpp
|
|
|
|
$(DEPEND_CMD) > $@
|
|
|
|
|
2008-07-09 19:09:50 +00:00
|
|
|
%.o: %.d
|
|
|
|
|
2008-04-18 19:28:40 +00:00
|
|
|
%$(EXESUF): %.c
|
|
|
|
|
2008-06-19 16:57:38 +00:00
|
|
|
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
|
|
|
|
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
|
|
|
|
$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
|
|
|
|
endif
|
|
|
|
|
2009-03-02 09:33:57 +00:00
|
|
|
$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
|
2009-01-26 09:10:04 +00:00
|
|
|
$< $(SRC_PATH) $@ $(EXTRA_VERSION)
|
2008-06-19 16:57:38 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
install: install-libs install-headers
|
2008-03-26 09:39:12 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
uninstall: uninstall-libs uninstall-headers
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2009-03-22 23:13:21 +00:00
|
|
|
.PHONY: all depend dep *clean install* uninstall* examples testprogs
|
2008-04-07 21:16:31 +00:00
|
|
|
endif
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2009-04-12 22:48:44 +00:00
|
|
|
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
|
|
|
|
|
2009-03-25 18:14:28 +00:00
|
|
|
CFLAGS += $(CFLAGS-yes)
|
|
|
|
OBJS += $(OBJS-yes)
|
|
|
|
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
|
|
|
TESTPROGS += $(TESTPROGS-yes)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2008-04-07 21:16:31 +00:00
|
|
|
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
|
2009-04-01 00:53:25 +00:00
|
|
|
FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2009-03-29 14:35:20 +00:00
|
|
|
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
|
2009-03-25 18:14:28 +00:00
|
|
|
OBJS := $(addprefix $(SUBDIR),$(OBJS))
|
2009-03-25 18:19:20 +00:00
|
|
|
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2009-05-20 10:24:59 +00:00
|
|
|
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME))
|
2008-04-09 21:11:39 +00:00
|
|
|
|
2009-01-11 22:48:07 +00:00
|
|
|
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
2008-04-07 21:16:31 +00:00
|
|
|
checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2008-04-09 20:48:17 +00:00
|
|
|
DEPS := $(OBJS:.o=.d)
|
|
|
|
depend dep: $(DEPS)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2009-05-29 11:56:54 +00:00
|
|
|
CLEANSUFFIXES = *.o *~ *.ho *.map
|
2008-06-16 18:01:55 +00:00
|
|
|
DISTCLEANSUFFIXES = *.d *.pc
|
2009-05-29 11:56:54 +00:00
|
|
|
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
|
2008-02-25 09:22:11 +00:00
|
|
|
|
2008-08-13 18:20:54 +00:00
|
|
|
-include $(DEPS)
|