2006-02-13 14:53:25 +02:00
|
|
|
#
|
|
|
|
# common bits used by all libraries
|
|
|
|
#
|
|
|
|
|
2010-03-09 16:58:18 +02:00
|
|
|
# first so "all" becomes default target
|
|
|
|
all: all-yes
|
2008-03-07 21:27:17 +02:00
|
|
|
|
2012-03-28 00:10:02 +03:00
|
|
|
include $(SRC_PATH)/arch.mak
|
2009-04-13 01:48:44 +03:00
|
|
|
|
2009-03-25 20:14:28 +02:00
|
|
|
OBJS += $(OBJS-yes)
|
2014-05-15 19:11:19 +03:00
|
|
|
FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
|
2009-03-25 20:14:28 +02:00
|
|
|
TESTPROGS += $(TESTPROGS-yes)
|
2006-02-13 14:53:25 +02:00
|
|
|
|
2012-08-28 18:06:56 +03:00
|
|
|
LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
|
|
|
|
FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
|
2006-02-13 14:53:25 +02:00
|
|
|
|
2011-06-28 16:45:57 +03:00
|
|
|
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
|
2016-04-20 11:40:40 +02:00
|
|
|
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
|
|
|
|
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
|
2011-06-28 16:45:57 +03:00
|
|
|
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
|
|
|
|
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
|
2011-07-10 22:26:25 +03:00
|
|
|
TOOLS += $(TOOLS-yes)
|
|
|
|
TOOLOBJS := $(TOOLS:%=tools/%.o)
|
|
|
|
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
|
2012-10-25 17:13:06 +03:00
|
|
|
HEADERS += $(HEADERS-yes)
|
2006-02-13 14:53:25 +02:00
|
|
|
|
2015-07-21 23:22:42 +02:00
|
|
|
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
|
|
|
|
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
|
|
|
|
STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
|
2008-04-10 00:11:39 +03:00
|
|
|
|
2013-03-01 21:52:32 +03:00
|
|
|
SRC_DIR := $(SRC_PATH)/lib$(NAME)
|
2009-01-12 00:48:07 +02:00
|
|
|
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
2011-06-28 16:45:57 +03:00
|
|
|
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
|
|
|
|
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
|
2012-08-07 04:11:25 +03:00
|
|
|
HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
|
|
|
|
checkheaders: $(HOBJS)
|
|
|
|
.SECONDARY: $(HOBJS:.o=.c)
|
2006-02-13 14:53:25 +02:00
|
|
|
|
2011-07-10 22:26:25 +03:00
|
|
|
alltools: $(TOOLS)
|
|
|
|
|
2009-10-29 02:55:35 +02:00
|
|
|
$(HOSTOBJS): %.o: %.c
|
2013-12-02 05:51:48 +03:00
|
|
|
$(COMPILE_HOSTC)
|
2009-10-29 02:55:35 +02:00
|
|
|
|
|
|
|
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
2013-11-11 00:19:07 +03:00
|
|
|
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTLIBS)
|
2009-10-29 02:55:35 +02:00
|
|
|
|
2011-07-10 22:05:45 +03:00
|
|
|
$(OBJS): | $(sort $(dir $(OBJS)))
|
2013-02-20 02:15:15 +03:00
|
|
|
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
2011-07-10 22:05:45 +03:00
|
|
|
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
|
|
|
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
2011-07-10 22:26:25 +03:00
|
|
|
$(TOOLOBJS): | tools
|
2011-06-28 20:45:13 +03:00
|
|
|
|
2013-02-20 02:15:15 +03:00
|
|
|
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
|
2011-06-28 20:45:13 +03:00
|
|
|
|
2016-05-27 11:38:38 +02:00
|
|
|
CLEANSUFFIXES = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver
|
2009-11-22 16:22:13 +02:00
|
|
|
DISTCLEANSUFFIXES = *.pc
|
2012-04-30 11:33:49 +03:00
|
|
|
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
|
2008-02-25 11:22:11 +02:00
|
|
|
|
2012-12-10 17:55:28 +03:00
|
|
|
define RULES
|
2012-09-15 21:33:56 +03:00
|
|
|
clean::
|
2016-04-20 11:40:40 +02:00
|
|
|
$(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
|
2012-12-10 17:55:28 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(RULES))
|
2012-09-15 21:33:56 +03:00
|
|
|
|
2012-08-07 04:11:25 +03:00
|
|
|
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))
|