annotate common.mak @ 31277:5d5bda998a2f

Move code printing -identify output for a file to a separate function.
author reimar
date Mon, 07 Jun 2010 17:12:49 +0000
parents 0f9c3f446fc6
children e061d5d981ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
1 #
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
2 # common bits used by all libraries
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
3 #
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
4
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
5 # first so "all" becomes default target
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
6 all: all-yes
26155
ba3e34112e47 sync with FFmpeg r12354
diego
parents: 24858
diff changeset
7
26317
955f4b8ac094 Merge simplifications from FFmpeg r12764.
diego
parents: 26315
diff changeset
8 ifndef SUBDIR
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
9 vpath %.c $(SRC_DIR)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
10 vpath %.h $(SRC_DIR)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
11 vpath %.S $(SRC_DIR)
27868
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
12 vpath %.asm $(SRC_DIR)
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
13 vpath %.v $(SRC_DIR)
27868
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
14
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
15 ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
16 BUILD_ROOT_REL = .
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
17 else
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
18 BUILD_ROOT_REL = ..
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
19 endif
26155
ba3e34112e47 sync with FFmpeg r12354
diego
parents: 24858
diff changeset
20
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
21 ifndef V
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
22 Q = @
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
23 ECHO = printf "$(1)\t%s\n" $(2)
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
24 BRIEF = CC AS YASM AR LD HOSTCC STRIP CP
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
25 SILENT = DEPCC YASMDEP RM RANLIB
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
26 MSG = $@
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
27 M = @$(call ECHO,$(TAG),$@);
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
28 $(foreach VAR,$(BRIEF), \
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
29 $(eval $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
30 $(foreach VAR,$(SILENT),$(eval $(VAR) = @$($(VAR))))
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
31 $(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
32 endif
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
33
26155
ba3e34112e47 sync with FFmpeg r12354
diego
parents: 24858
diff changeset
34 ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
35
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
36 CPPFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
37 CFLAGS += $(ECFLAGS)
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
38
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
39 %.o: %.c
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
40 $(CCDEP)
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
41 $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
42
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
43 %.o: %.S
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
44 $(ASDEP)
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
45 $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
46
24775
16f77f3eb187 Sync with FFmpeg r10774.
diego
parents: 23524
diff changeset
47 %.ho: %.h
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
48 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
27868
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
49
26671
24e6708e030c Sync with latest FFmpeg changes.
diego
parents: 26403
diff changeset
50 %$(EXESUF): %.c
24e6708e030c Sync with latest FFmpeg changes.
diego
parents: 26403
diff changeset
51
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
52 %.ver: %.v
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
53 $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
27868
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
54
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
55 %.c %.h: TAG = GEN
27868
c4913507c4ba Sync with latest FFmpeg changes.
diego
parents: 26671
diff changeset
56
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
57 install: install-libs install-headers
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
58 install-libs: install-libs-yes
17627
24238abbd150 Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff changeset
59
19016
837e543350b3 sync with FFmpeg r5718
diego
parents: 18311
diff changeset
60 uninstall: uninstall-libs uninstall-headers
837e543350b3 sync with FFmpeg r5718
diego
parents: 18311
diff changeset
61
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
62 .PHONY: all depend dep *clean install* uninstall* examples testprogs
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
63
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
64 # Disable suffix rules. Most of the builtin rules are suffix rules,
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
65 # so this saves some time on slow systems.
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
66 .SUFFIXES:
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
67
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
68 # Do not delete intermediate files from chains of implicit rules
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
69 $(OBJS):
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
70 endif
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
71
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
72 OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
73
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
74 CFLAGS += $(CFLAGS-yes)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
75 OBJS += $(OBJS-yes)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
76 FFLIBS := $(FFLIBS-yes) $(FFLIBS)
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
77 TESTPROGS += $(TESTPROGS-yes)
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
78
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
79 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
80 FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
81
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
82 EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
83 OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS)))
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
84 TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS))
29136
cfdba9b5abba Sync with latest FFmpeg changes.
diego
parents: 28444
diff changeset
85 TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
86 HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
87 HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
88
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
89 DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
26403
c7c1cc069961 Sync with latest FFmpeg changes.
diego
parents: 26317
diff changeset
90
28444
bffc31262b0e Sync with latest FFmpeg changes.
diego
parents: 28143
diff changeset
91 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
92 SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
93 SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
94 checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
19016
837e543350b3 sync with FFmpeg r5718
diego
parents: 18311
diff changeset
95
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
96 $(HOSTOBJS): %.o: %.c
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
97 $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
98
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
99 $(HOSTPROGS): %$(HOSTEXESUF): %.o
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
100 $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
101
26403
c7c1cc069961 Sync with latest FFmpeg changes.
diego
parents: 26317
diff changeset
102 DEPS := $(OBJS:.o=.d)
c7c1cc069961 Sync with latest FFmpeg changes.
diego
parents: 26317
diff changeset
103 depend dep: $(DEPS)
26315
a80f0a7d73f4 Sync with FFmpeg's shiny new non-recursive build system.
diego
parents: 26246
diff changeset
104
31273
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
105 CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
0f9c3f446fc6 Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents: 29672
diff changeset
106 DISTCLEANSUFFIXES = *.pc
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
107 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
26155
ba3e34112e47 sync with FFmpeg r12354
diego
parents: 24858
diff changeset
108
29672
bc094de7968e Sync with current FFmpeg HEAD.
diego
parents: 29136
diff changeset
109 -include $(wildcard $(DEPS))