Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 114 lines (78 sloc) 2.788 kb
490373d move common parts of makefiles into common.mak
mru authored
1 #
2 # common bits used by all libraries
3 #
4
5d91066 non-recursive makefiles
mru authored
5 all: # make "all" default target
14edbf1 simplify library version handling
mru authored
6
6d93e25 replace some ifeq with prettier ifdef
mru authored
7 ifndef SUBDIR
29e9275 rename LIBSRC to SRC_DIR, add quotes where SRC_DIR was used
mru authored
8 vpath %.c $(SRC_DIR)
9 vpath %.h $(SRC_DIR)
10 vpath %.S $(SRC_DIR)
2fc2b1f yasm buildsystem
lorenm authored
11 vpath %.asm $(SRC_DIR)
490373d move common parts of makefiles into common.mak
mru authored
12
d11b29e enable version.h to be created from subdirs
mru authored
13 ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
14 BUILD_ROOT_REL = .
15 else
16 BUILD_ROOT_REL = ..
17 endif
18
0b76aa0 consolidate CFLAGS, LDFLAGS, EXTRALIBS assignment
mru authored
19 ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
20
d11b29e enable version.h to be created from subdirs
mru authored
21 CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
367fb7c Move -D_ISOC9X_SOURCE to configure so its available to all tests.
michael authored
22 -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
490373d move common parts of makefiles into common.mak
mru authored
23
24 %.o: %.c
25 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
26
27 %.o: %.S
28 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
29
b57cb50 add "checkheaders" target
mru authored
30 %.ho: %.h
31 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
32
cff8fe4 generate separate dependency files per object file
mru authored
33 %.d: %.c
34 $(DEPEND_CMD) > $@
35
36 %.d: %.S
37 $(DEPEND_CMD) > $@
38
39 %.d: %.cpp
40 $(DEPEND_CMD) > $@
41
f33d246 regenerate dependencies when building object files
mru authored
42 %.o: %.d
43
25b2641 fix make tests in subdirs
mru authored
44 %$(EXESUF): %.c
45
d11b29e enable version.h to be created from subdirs
mru authored
46 SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
47 ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
48 $(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
49 endif
50
a1a1894 version.h depends on version.sh.
diego authored
51 $(BUILD_ROOT_REL)/version.h: $(SRC_PATH)/version.sh
52 $< $(SRC_PATH) $@ $(EXTRA_VERSION)
d11b29e enable version.h to be created from subdirs
mru authored
53
5d91066 non-recursive makefiles
mru authored
54 install: install-libs install-headers
e3c26d6 Use common.mak in the top-level Makefile as well.
diego authored
55
5d91066 non-recursive makefiles
mru authored
56 uninstall: uninstall-libs uninstall-headers
490373d move common parts of makefiles into common.mak
mru authored
57
5d91066 non-recursive makefiles
mru authored
58 .PHONY: all depend dep clean distclean install* uninstall* tests
59 endif
490373d move common parts of makefiles into common.mak
mru authored
60
5d91066 non-recursive makefiles
mru authored
61 CFLAGS += $(CFLAGS-yes)
62 OBJS += $(OBJS-yes)
63 FFLIBS := $(FFLIBS-yes) $(FFLIBS)
db791c7 append TESTS-yes to TESTS; one ifeq less
mru authored
64 TESTS += $(TESTS-yes)
490373d move common parts of makefiles into common.mak
mru authored
65
5d91066 non-recursive makefiles
mru authored
66 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
67 FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
490373d move common parts of makefiles into common.mak
mru authored
68
5d91066 non-recursive makefiles
mru authored
69 OBJS := $(addprefix $(SUBDIR),$(OBJS))
70 TESTS := $(addprefix $(SUBDIR),$(TESTS))
490373d move common parts of makefiles into common.mak
mru authored
71
a482fc0 move DEP_LIBS to common.mak
mru authored
72 DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME))
73
d06968e Extend 'checkheaders' target to architecture-specific subdirectories.
diego authored
74 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
5d91066 non-recursive makefiles
mru authored
75 checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
490373d move common parts of makefiles into common.mak
mru authored
76
cff8fe4 generate separate dependency files per object file
mru authored
77 DEPS := $(OBJS:.o=.d)
78 depend dep: $(DEPS)
490373d move common parts of makefiles into common.mak
mru authored
79
1a925a9 Revert "Add version information to DLLs."
mru authored
80 CLEANSUFFIXES = *.o *~ *.ho
f9817d8 Split CLEANFILES variable into CLEANSUFFIXES and LIBSUFFIXES.
diego authored
81 LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
ab9959e Generate pkg-config files in each library subdirectory so that they do
diego authored
82 DISTCLEANSUFFIXES = *.d *.pc
37ddf94 Install headers in $prefix/include/$libname
mru authored
83
5d91066 non-recursive makefiles
mru authored
84 define RULES
59f426d fix building of test programs (make tests)
mru authored
85 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
86 $(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
490373d move common parts of makefiles into common.mak
mru authored
87
59f426d fix building of test programs (make tests)
mru authored
88 $(SUBDIR)%-test.o: $(SUBDIR)%.c
89 $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
90
91 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
92 $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
3a6b81d uninstallation support
diego authored
93
a1b41e7 Rename libavcodec/i386/ --> libavcodec/x86/.
diego authored
94 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
2fc2b1f yasm buildsystem
lorenm authored
95 $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
96
a1b41e7 Rename libavcodec/i386/ --> libavcodec/x86/.
diego authored
97 $(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
2fc2b1f yasm buildsystem
lorenm authored
98 $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
99
5d91066 non-recursive makefiles
mru authored
100 clean::
edd4f12 Generate the list of files to clean in subdirectories in common.mak.
diego authored
101 rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
102 $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
3a6b81d uninstallation support
diego authored
103
5d91066 non-recursive makefiles
mru authored
104 distclean:: clean
2a3730b Remove all dependency files on distclean.
diego authored
105 rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
106 $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
5d91066 non-recursive makefiles
mru authored
107 endef
59f7448 Move common test program infrastructure to common.mak.
diego authored
108
5d91066 non-recursive makefiles
mru authored
109 $(eval $(RULES))
59f7448 Move common test program infrastructure to common.mak.
diego authored
110
5d91066 non-recursive makefiles
mru authored
111 tests: $(TESTS)
e427693 Mark all phony targets as such.
diego authored
112
0428af2 10000l, revert mistakely commited and unrelated hunk.
michael authored
113 -include $(DEPS)
Something went wrong with that request. Please try again.