h264: simplify calls to ff_er_add_slice().
[FFMpeg-mirror/mplayer-patches.git] / common.mak
blob5d80986aab81d0097ee0e3b06763d538c73cd37d
2 # common bits used by all libraries
5 # first so "all" becomes default target
6 all: all-yes
8 include $(SRC_PATH)/arch.mak
10 OBJS += $(OBJS-yes)
11 FFLIBS := $(FFLIBS-yes) $(FFLIBS)
12 TESTPROGS += $(TESTPROGS-yes)
14 LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
15 FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
17 EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
18 OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
19 TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
20 TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
21 HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
22 HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
23 TOOLS += $(TOOLS-yes)
24 TOOLOBJS := $(TOOLS:%=tools/%.o)
25 TOOLS := $(TOOLS:%=tools/%$(EXESUF))
26 HEADERS += $(HEADERS-yes)
28 DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
30 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
31 SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
32 SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
33 HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
34 checkheaders: $(HOBJS)
35 .SECONDARY: $(HOBJS:.o=.c)
37 alltools: $(TOOLS)
39 $(HOSTOBJS): %.o: %.c
40 $(call COMPILE,HOSTCC)
42 $(HOSTPROGS): %$(HOSTEXESUF): %.o
43 $(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)
45 $(OBJS): | $(sort $(dir $(OBJS)))
46 $(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
47 $(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
48 $(TOOLOBJS): | tools
50 OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
52 CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver
53 DISTCLEANSUFFIXES = *.pc
54 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
56 define RULES
57 clean::
58 $(RM) $(OBJS) $(OBJS:.o=.d)
59 $(RM) $(HOSTPROGS)
60 $(RM) $(TOOLS)
61 endef
63 $(eval $(RULES))
65 -include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))