Statistics
| Branch: | Revision:

ffmpeg / common.mak @ d7c2e8e3

History | View | Annotate | Download (2.07 KB)

1 8b2121e3 Måns Rullgård
#
2
# common bits used by all libraries
3
#
4
5 71c61f62 Måns Rullgård
all: # make "all" default target
6 0e32c8c6 Måns Rullgård
7 8e255b8b Måns Rullgård
ifndef SUBDIR
8 6ccf540f Diego Biurrun
vpath %.c   $(SRC_DIR)
9
vpath %.h   $(SRC_DIR)
10
vpath %.S   $(SRC_DIR)
11 304d586d Loren Merritt
vpath %.asm $(SRC_DIR)
12 8b2121e3 Måns Rullgård
13 9e6165b5 Måns Rullgård
ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
14
BUILD_ROOT_REL = .
15
else
16
BUILD_ROOT_REL = ..
17
endif
18
19 5671fc14 Måns Rullgård
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
20
21 04a803be Stefano Sabatini
CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
22 8b2121e3 Måns Rullgård
23
%.o: %.c
24 07dec06e Måns Rullgård
	$(CCDEP)
25 bce7b696 Måns Rullgård
	$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
26 8b2121e3 Måns Rullgård
27
%.o: %.S
28 07dec06e Måns Rullgård
	$(ASDEP)
29 bce7b696 Måns Rullgård
	$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
30 8b2121e3 Måns Rullgård
31 e4d86a57 Måns Rullgård
%.ho: %.h
32 bce7b696 Måns Rullgård
	$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
33 e4d86a57 Måns Rullgård
34 bf237413 Måns Rullgård
%$(EXESUF): %.c
35
36 9e6165b5 Måns Rullgård
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
37
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
38
$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
39
endif
40
41 873b0923 Diego Biurrun
$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
42 1db2c5c9 Diego Biurrun
	$< $(SRC_PATH) $@ $(EXTRA_VERSION)
43 9e6165b5 Måns Rullgård
44 71c61f62 Måns Rullgård
install: install-libs install-headers
45 7716f7ff Diego Biurrun
46 71c61f62 Måns Rullgård
uninstall: uninstall-libs uninstall-headers
47 8b2121e3 Måns Rullgård
48 661ce289 Diego Biurrun
.PHONY: all depend dep *clean install* uninstall* examples testprogs
49 71c61f62 Måns Rullgård
endif
50 8b2121e3 Måns Rullgård
51 c5662879 Diego Biurrun
OBJS-$(HAVE_MMX) +=  $(MMX-OBJS-yes)
52
53 6ccf540f Diego Biurrun
CFLAGS    += $(CFLAGS-yes)
54
OBJS      += $(OBJS-yes)
55
FFLIBS    := $(FFLIBS-yes) $(FFLIBS)
56
TESTPROGS += $(TESTPROGS-yes)
57 8b2121e3 Måns Rullgård
58 71c61f62 Måns Rullgård
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
59 bdc2cc16 Måns Rullgård
FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
60 8b2121e3 Måns Rullgård
61 43a0cb7c Diego Biurrun
EXAMPLES  := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
62 6ccf540f Diego Biurrun
OBJS      := $(addprefix $(SUBDIR),$(OBJS))
63 7304c2c4 Diego Biurrun
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
64 8b2121e3 Måns Rullgård
65 bea81a52 Måns Rullgård
DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
66 76ca42a8 Måns Rullgård
67 7b5e8a27 Diego Biurrun
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
68 95f2c769 Måns Rullgård
SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
69
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
70 8b2121e3 Måns Rullgård
71 caec74dd Måns Rullgård
DEPS := $(OBJS:.o=.d)
72
depend dep: $(DEPS)
73 8b2121e3 Måns Rullgård
74 8e8a67fa Dave Yeo
CLEANSUFFIXES     = *.o *~ *.ho *.map
75 25cd5cb3 Diego Biurrun
DISTCLEANSUFFIXES = *.d *.pc
76 8e8a67fa Dave Yeo
LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
77 76a448ed Måns Rullgård
78 c1c3933a Måns Rullgård
-include $(wildcard $(DEPS))