Remove pointless empty line.
[libav.git] / common.mak
CommitLineData
8b2121e3
MR
1#
2# common bits used by all libraries
3#
4
71c61f62 5all: # make "all" default target
0e32c8c6 6
8e255b8b 7ifndef SUBDIR
6ccf540f
DB
8vpath %.c $(SRC_DIR)
9vpath %.h $(SRC_DIR)
10vpath %.S $(SRC_DIR)
304d586d 11vpath %.asm $(SRC_DIR)
a482e61b 12vpath %.v $(SRC_DIR)
8b2121e3 13
9e6165b5
MR
14ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
15BUILD_ROOT_REL = .
16else
17BUILD_ROOT_REL = ..
18endif
19
5671fc14
MR
20ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
21
04a803be 22CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
8be0a5c3 23CFLAGS += $(ECFLAGS)
8b2121e3
MR
24
25%.o: %.c
07dec06e 26 $(CCDEP)
bce7b696 27 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
8b2121e3
MR
28
29%.o: %.S
07dec06e 30 $(ASDEP)
bce7b696 31 $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
8b2121e3 32
e4d86a57 33%.ho: %.h
bce7b696 34 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
e4d86a57 35
bf237413
MR
36%$(EXESUF): %.c
37
a482e61b
MR
38%.ver: %.v
39 sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
40
9e6165b5
MR
41SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
42ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
43$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
44endif
45
873b0923 46$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
1db2c5c9 47 $< $(SRC_PATH) $@ $(EXTRA_VERSION)
9e6165b5 48
71c61f62 49install: install-libs install-headers
7716f7ff 50
d3cb93b3
RP
51uninstall: uninstall-libs uninstall-headers
52
53.PHONY: all depend dep *clean install* uninstall* examples testprogs
71c61f62 54endif
8b2121e3 55
c5662879
DB
56OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
57
8be0a5c3 58CFLAGS += $(CFLAGS-yes)
6ccf540f
DB
59OBJS += $(OBJS-yes)
60FFLIBS := $(FFLIBS-yes) $(FFLIBS)
61TESTPROGS += $(TESTPROGS-yes)
8b2121e3 62
71c61f62 63FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
bdc2cc16 64FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
8b2121e3 65
43a0cb7c 66EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
6ccf540f 67OBJS := $(addprefix $(SUBDIR),$(OBJS))
7304c2c4 68TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
de4070b5
MR
69HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
70HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
8b2121e3 71
bea81a52 72DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
76ca42a8 73
7b5e8a27 74ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
95f2c769
MR
75SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
76checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
8b2121e3 77
de4070b5
MR
78$(HOSTOBJS): %.o: %.c
79 $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
80
81$(HOSTPROGS): %$(HOSTEXESUF): %.o
82 $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
83
caec74dd
MR
84DEPS := $(OBJS:.o=.d)
85depend dep: $(DEPS)
8b2121e3 86
a482e61b 87CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
79de9c83 88DISTCLEANSUFFIXES = *.pc
8e8a67fa 89LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
76a448ed 90
c1c3933a 91-include $(wildcard $(DEPS))