Move some some functions around, so that splitting the SDP code out of
[ffmpeg-lucabe.git] / common.mak
blob396772bf64d84f531f4f632c95350c78b34bcdd3
2 # common bits used by all libraries
5 all: # make "all" default target
7 ifndef SUBDIR
8 vpath %.c $(SRC_DIR)
9 vpath %.h $(SRC_DIR)
10 vpath %.S $(SRC_DIR)
11 vpath %.asm $(SRC_DIR)
13 ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
14 BUILD_ROOT_REL = .
15 else
16 BUILD_ROOT_REL = ..
17 endif
19 ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
21 CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
23 %.o: %.c
24 $(CCDEP)
25 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
27 %.o: %.S
28 $(ASDEP)
29 $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
31 %.ho: %.h
32 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
34 %$(EXESUF): %.c
36 SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
37 ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
38 $(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
39 endif
41 $(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
42 $< $(SRC_PATH) $@ $(EXTRA_VERSION)
44 install: install-libs install-headers
46 uninstall: uninstall-libs uninstall-headers
48 .PHONY: all depend dep *clean install* uninstall* examples testprogs
49 endif
51 OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
53 CFLAGS += $(CFLAGS-yes)
54 OBJS += $(OBJS-yes)
55 FFLIBS := $(FFLIBS-yes) $(FFLIBS)
56 TESTPROGS += $(TESTPROGS-yes)
58 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
59 FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
61 EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
62 OBJS := $(addprefix $(SUBDIR),$(OBJS))
63 TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
64 HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
65 HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
67 DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
69 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
70 SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
71 checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
73 $(HOSTOBJS): %.o: %.c
74 $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
76 $(HOSTPROGS): %$(HOSTEXESUF): %.o
77 $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
79 DEPS := $(OBJS:.o=.d)
80 depend dep: $(DEPS)
82 CLEANSUFFIXES = *.o *~ *.ho *.map
83 DISTCLEANSUFFIXES = *.d *.pc
84 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
86 -include $(wildcard $(DEPS))