2006-02-13 12:53:25 +00:00
|
|
|
#
|
|
|
|
# common bits used by all libraries
|
|
|
|
#
|
|
|
|
|
2012-03-27 21:10:02 +00:00
|
|
|
include $(SRC_PATH)/arch.mak
|
2009-04-12 22:48:44 +00:00
|
|
|
|
2009-03-25 18:14:28 +00:00
|
|
|
OBJS += $(OBJS-yes)
|
2014-05-15 16:11:19 +00:00
|
|
|
FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
|
2009-03-25 18:14:28 +00:00
|
|
|
TESTPROGS += $(TESTPROGS-yes)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2013-03-25 13:59:50 +00:00
|
|
|
FFEXTRALIBS := $(FFLIBS:%=$(LD_LIB)) $(EXTRALIBS)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2011-06-28 13:45:57 +00:00
|
|
|
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
|
2016-04-20 09:40:40 +00:00
|
|
|
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
|
|
|
|
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
|
2011-06-28 13:45:57 +00:00
|
|
|
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))
|
2012-10-25 14:13:06 +00:00
|
|
|
HEADERS += $(HEADERS-yes)
|
2006-02-13 12:53:25 +00:00
|
|
|
|
2015-07-21 21:22:42 +00: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-09 21:11:39 +00:00
|
|
|
|
2013-03-01 18:52:32 +00:00
|
|
|
SRC_DIR := $(SRC_PATH)/lib$(NAME)
|
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)%)
|
2012-08-07 01:11:25 +00:00
|
|
|
HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
|
2016-03-09 14:39:29 +00:00
|
|
|
$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
|
2012-08-07 01:11:25 +00:00
|
|
|
checkheaders: $(HOBJS)
|
|
|
|
.SECONDARY: $(HOBJS:.o=.c)
|
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
|
2013-12-02 02:51:48 +00:00
|
|
|
$(COMPILE_HOSTC)
|
2009-10-29 00:55:35 +00:00
|
|
|
|
|
|
|
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
2016-12-06 17:19:09 +00:00
|
|
|
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
|
2009-10-29 00:55:35 +00:00
|
|
|
|
2011-07-10 19:05:45 +00:00
|
|
|
$(OBJS): | $(sort $(dir $(OBJS)))
|
2013-02-19 23:15:15 +00:00
|
|
|
$(HOBJS): | $(sort $(dir $(HOBJS)))
|
2011-07-10 19:05:45 +00:00
|
|
|
$(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
|
|
|
|
2013-02-19 23:15:15 +00:00
|
|
|
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
|
2011-06-28 17:45:13 +00:00
|
|
|
|
2016-05-27 09:38:38 +00:00
|
|
|
CLEANSUFFIXES = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver
|
2009-11-22 14:22:13 +00:00
|
|
|
DISTCLEANSUFFIXES = *.pc
|
2012-04-30 08:33:49 +00:00
|
|
|
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
|
2008-02-25 09:22:11 +00:00
|
|
|
|
2012-12-10 14:55:28 +00:00
|
|
|
define RULES
|
2012-09-15 18:33:56 +00:00
|
|
|
clean::
|
2016-04-20 09:40:40 +00:00
|
|
|
$(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
|
2012-12-10 14:55:28 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(RULES))
|
2012-09-15 18:33:56 +00:00
|
|
|
|
2012-08-07 01:11:25 +00:00
|
|
|
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))
|