2006-02-13 12:53:25 +00:00
|
|
|
#
|
|
|
|
# common bits used by all libraries
|
|
|
|
#
|
|
|
|
|
2010-03-09 14:58:18 +00:00
|
|
|
# first so "all" becomes default target
|
|
|
|
all: all-yes
|
2008-03-07 19:27:17 +00:00
|
|
|
|
2009-04-12 22:48:44 +00:00
|
|
|
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
|
|
|
|
|
2009-03-25 18:14:28 +00:00
|
|
|
OBJS += $(OBJS-yes)
|
|
|
|
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
|
|
|
TESTPROGS += $(TESTPROGS-yes)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2011-06-28 13:45:57 +00:00
|
|
|
FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2011-06-28 13:45:57 +00:00
|
|
|
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
|
|
|
|
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
|
|
|
|
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
|
|
|
|
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
|
|
|
|
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
|
|
|
|
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
|
2011-07-10 19:26:25 +00:00
|
|
|
TOOLS += $(TOOLS-yes)
|
|
|
|
TOOLOBJS := $(TOOLS:%=tools/%.o)
|
|
|
|
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2011-05-28 12:10:01 +00:00
|
|
|
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_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))
|
2011-06-28 13:45:57 +00:00
|
|
|
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
|
|
|
|
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
|
2009-08-23 11:02:37 +00:00
|
|
|
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2011-07-10 19:26:25 +00:00
|
|
|
alltools: $(TOOLS)
|
|
|
|
|
2009-10-29 00:55:35 +00:00
|
|
|
$(HOSTOBJS): %.o: %.c
|
|
|
|
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
|
|
|
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
|
|
|
|
|
2011-07-10 19:05:45 +00:00
|
|
|
$(OBJS): | $(sort $(dir $(OBJS)))
|
|
|
|
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
|
|
|
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
2011-07-10 19:26:25 +00:00
|
|
|
$(TOOLOBJS): | tools
|
2011-06-28 17:45:13 +00:00
|
|
|
|
|
|
|
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
|
|
|
|
|
2010-01-16 04:49:02 +00:00
|
|
|
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
|
2009-11-22 14:22:13 +00:00
|
|
|
DISTCLEANSUFFIXES = *.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
|
|
|
|
2013-01-03 14:30:22 +00:00
|
|
|
define RULES
|
|
|
|
clean::
|
|
|
|
$(RM) $(OBJS) $(OBJS:.o=.d)
|
|
|
|
$(RM) $(HOSTPROGS)
|
|
|
|
$(RM) $(TOOLS)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(RULES))
|
|
|
|
|
2011-03-30 20:23:04 +00:00
|
|
|
-include $(wildcard $(OBJS:.o=.d) $(TESTOBJS:.o=.d))
|