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