2 # common bits used by all libraries
5 # first so "all" becomes default target
8 include $(SRC_PATH)/arch.mak
11 FFLIBS := $(FFLIBS-yes) $(FFLIBS)
12 TESTPROGS += $(TESTPROGS-yes)
14 FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
16 EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
17 OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
18 TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
19 TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
20 HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
21 HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
23 TOOLOBJS := $(TOOLS:%=tools/%.o)
24 TOOLS := $(TOOLS:%=tools/%$(EXESUF))
26 DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
28 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
29 SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
30 SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
31 checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
36 $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
38 $(HOSTPROGS): %$(HOSTEXESUF): %.o
39 $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
41 $(OBJS): | $(sort $(dir $(OBJS)))
42 $(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
43 $(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
46 OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
48 CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
49 DISTCLEANSUFFIXES = *.pc
50 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
52 -include $(wildcard $(OBJS:.o=.d) $(TESTOBJS:.o=.d))