build: Drop stray golomb dependencies
[libav.git] / common.mak
CommitLineData
8b2121e3
MR
1#
2# common bits used by all libraries
3#
4
7bb3a302 5include $(SRC_PATH)/arch.mak
c5662879 6
6ccf540f 7OBJS += $(OBJS-yes)
afe17626 8FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
6ccf540f 9TESTPROGS += $(TESTPROGS-yes)
8b2121e3 10
14bba44f 11FFEXTRALIBS := $(FFLIBS:%=$(LD_LIB)) $(EXTRALIBS)
8b2121e3 12
deb3ed01 13OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
a6a750c7
DB
14TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
15TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
deb3ed01
MR
16HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
17HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
28e1c979
MR
18TOOLS += $(TOOLS-yes)
19TOOLOBJS := $(TOOLS:%=tools/%.o)
20TOOLS := $(TOOLS:%=tools/%$(EXESUF))
121604b0 21HEADERS += $(HEADERS-yes)
8b2121e3 22
3ae0e721
LB
23PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
24DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
25STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
76ca42a8 26
7c22d048 27SRC_DIR := $(SRC_PATH)/lib$(NAME)
7b5e8a27 28ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
deb3ed01
MR
29SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
30SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
dfd9159f 31HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
2575b191 32$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
dfd9159f
MR
33checkheaders: $(HOBJS)
34.SECONDARY: $(HOBJS:.o=.c)
8b2121e3 35
28e1c979
MR
36alltools: $(TOOLS)
37
de4070b5 38$(HOSTOBJS): %.o: %.c
ad477710 39 $(COMPILE_HOSTC)
de4070b5
MR
40
41$(HOSTPROGS): %$(HOSTEXESUF): %.o
e8fcdebb 42 $(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTLIBS)
de4070b5 43
3e5cce81 44$(OBJS): | $(sort $(dir $(OBJS)))
8a11ce43 45$(HOBJS): | $(sort $(dir $(HOBJS)))
3e5cce81
DB
46$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
47$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
28e1c979 48$(TOOLOBJS): | tools
5e27ec28 49
8a11ce43 50OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
5e27ec28 51
c5fd4b50 52CLEANSUFFIXES = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver
79de9c83 53DISTCLEANSUFFIXES = *.pc
b5a3c603 54LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
76a448ed 55
395c3feb 56define RULES
1c9d54b4 57clean::
a6a750c7 58 $(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
395c3feb
MR
59endef
60
61$(eval $(RULES))
1c9d54b4 62
dfd9159f 63-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))