Mercurial > mplayer.hg
annotate common.mak @ 32185:26e3bf13985e
Simplify glob() check.
author | diego |
---|---|
date | Thu, 16 Sep 2010 14:40:44 +0000 |
parents | 1b924c910cfe |
children | 7704ea4d6839 |
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 | 7 |
26317 | 8 ifndef SUBDIR |
29136 | 9 vpath %.c $(SRC_DIR) |
10 vpath %.h $(SRC_DIR) | |
11 vpath %.S $(SRC_DIR) | |
27868 | 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 | 14 |
15 ifeq ($(SRC_DIR),$(SRC_PATH_BARE)) | |
16 BUILD_ROOT_REL = . | |
17 else | |
18 BUILD_ROOT_REL = .. | |
19 endif | |
26155 | 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), \ |
31870 | 29 $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR)))) |
30 $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR)))) | |
31273
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 |
31870 | 34 ALLFFLIBS = avcodec avcore 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 |
31870 | 36 IFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH) |
37 CPPFLAGS := $(IFLAGS) $(CPPFLAGS) | |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
38 CFLAGS += $(ECFLAGS) |
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
39 |
31870 | 40 HOSTCFLAGS += $(IFLAGS) |
41 | |
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
42 %.o: %.c |
29672 | 43 $(CCDEP) |
44 $(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
|
45 |
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
46 %.o: %.S |
29672 | 47 $(ASDEP) |
48 $(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
|
49 |
24775 | 50 %.ho: %.h |
29672 | 51 $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $< |
27868 | 52 |
26671 | 53 %$(EXESUF): %.c |
54 | |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
55 %.ver: %.v |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
56 $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@ |
27868 | 57 |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
58 %.c %.h: TAG = GEN |
27868 | 59 |
31870 | 60 # Dummy rule to stop make trying to rebuild removed or renamed headers |
61 %.h: | |
62 @: | |
63 | |
17627
24238abbd150
Import common.mak v1.1 from ffmpeg cvs, now it's needed by the building
rtognimp
parents:
diff
changeset
|
64 install: install-libs install-headers |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
65 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
|
66 |
19016 | 67 uninstall: uninstall-libs uninstall-headers |
68 | |
29136 | 69 .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
|
70 |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
71 # 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
|
72 # so this saves some time on slow systems. |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
73 .SUFFIXES: |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
74 |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
75 # 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
|
76 $(OBJS): |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
77 endif |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
78 |
29136 | 79 OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes) |
80 | |
81 CFLAGS += $(CFLAGS-yes) | |
82 OBJS += $(OBJS-yes) | |
83 FFLIBS := $(FFLIBS-yes) $(FFLIBS) | |
84 TESTPROGS += $(TESTPROGS-yes) | |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
85 |
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
86 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS) |
29136 | 87 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
|
88 |
29136 | 89 EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES))) |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
90 OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS))) |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
91 TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS)) |
29136 | 92 TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS))) |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
93 HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS))) |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
94 HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS))) |
26315
a80f0a7d73f4
Sync with FFmpeg's shiny new non-recursive build system.
diego
parents:
26246
diff
changeset
|
95 |
29672 | 96 DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME)) |
26403 | 97 |
28444 | 98 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
|
99 SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS)) |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
100 SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS)) |
29672 | 101 checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho)) |
19016 | 102 |
31273
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
103 $(HOSTOBJS): %.o: %.c |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
104 $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
105 |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
106 $(HOSTPROGS): %$(HOSTEXESUF): %.o |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
107 $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS) |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
108 |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
109 CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver |
0f9c3f446fc6
Update common.mak and subdir.mak to latest FFmpeg versions.
reimar
parents:
29672
diff
changeset
|
110 DISTCLEANSUFFIXES = *.pc |
29672 | 111 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp |
26155 | 112 |
31886 | 113 -include $(wildcard $(OBJS:.o=.d)) |