Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 103 lines (77 sloc) 3.369 kB
f038cf3 @mansr build: remove SRC_PATH_BARE variable
mansr authored
1 SRC_DIR := $(SRC_PATH)/lib$(NAME)
71c61f6 @mansr non-recursive makefiles
mansr authored
2
57b4a3d @mansr build: include sub-makefiles using full path instead of symlinks
mansr authored
3 include $(SRC_PATH)/common.mak
71c61f6 @mansr non-recursive makefiles
mansr authored
4
5 LIBVERSION := $(lib$(NAME)_VERSION)
6 LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
477b338 @mansr cosmetic: move some makefile variable definitions
mansr authored
7 INCINSTDIR := $(INCDIR)/lib$(NAME)
8 THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
71c61f6 @mansr non-recursive makefiles
mansr authored
9
451db98 @mansr Simplify static/shared build rules
mansr authored
10 all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
11 all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
12
a854bcd @ramiropolla fix building test programs with gnu make 3.82
ramiropolla authored
13 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
659aa20 @mansr build: improve rules for test programs
mansr authored
14 $(COMPILE_C)
8c5239b @mansr Move some make rules outside of eval'd block
mansr authored
15
a854bcd @ramiropolla fix building test programs with gnu make 3.82
ramiropolla authored
16 $(SUBDIR)%-test.o: $(SUBDIR)%.c
659aa20 @mansr build: improve rules for test programs
mansr authored
17 $(COMPILE_C)
8c5239b @mansr Move some make rules outside of eval'd block
mansr authored
18
19 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
20 $(YASMDEP) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
21 $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
22
659aa20 @mansr build: improve rules for test programs
mansr authored
23 $(OBJS) $(SUBDIR)%.ho $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
24 $(TESTOBJS): CPPFLAGS += -DTEST
72c2bde @mansr Define HAVE_AV_CONFIG_H only when building libraries
mansr authored
25
71c61f6 @mansr non-recursive makefiles
mansr authored
26 $(SUBDIR)$(LIBNAME): $(OBJS)
50e10cb @mansr Use $(RM) to delete files
mansr authored
27 $(RM) $@
71c61f6 @mansr non-recursive makefiles
mansr authored
28 $(AR) rc $@ $^ $(EXTRAOBJS)
29 $(RANLIB) $@
30
5654067 @mansr 10l: fix make install with only shared libs
mansr authored
31 install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
32
451db98 @mansr Simplify static/shared build rules
mansr authored
33 install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
34 install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
35
71c61f6 @mansr non-recursive makefiles
mansr authored
36 define RULES
8a54bfe @lu-zero build: make examples build normally
lu-zero authored
37 $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
ca90361 @mansr build: remove unnecessary FFLDFLAGS variable
mansr authored
38 $$(LD) $(LDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
3fd422f @mansr Move make rules applicable only to subdirs into subdir.mak
mansr authored
39
71c61f6 @mansr non-recursive makefiles
mansr authored
40 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
63611f3 @mansr Prettify make output
mansr authored
41 $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
71c61f6 @mansr non-recursive makefiles
mansr authored
42
b3ca11f Revert "build: Add DEP_LIBS dependency directly to the shared library…
Reimar Döffinger authored
43 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
71c61f6 @mansr non-recursive makefiles
mansr authored
44 $(SLIB_CREATE_DEF_CMD)
ca90361 @mansr build: remove unnecessary FFLDFLAGS variable
mansr authored
45 $$(LD) $(SHFLAGS) $(LDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
71c61f6 @mansr non-recursive makefiles
mansr authored
46 $(SLIB_EXTRA_CMD)
47
b3ca11f Revert "build: Add DEP_LIBS dependency directly to the shared library…
Reimar Döffinger authored
48 ifdef SUBDIR
49 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
50 endif
51
0c8cc2c @mansr Reorder some make rules
mansr authored
52 clean::
53 $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
dc6632f @mansr build: simplify commands for clean target
mansr authored
54 $(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) \
0c8cc2c @mansr Reorder some make rules
mansr authored
55 $(HOSTOBJS) $(HOSTPROGS)
56
57 distclean:: clean
dc6632f @mansr build: simplify commands for clean target
mansr authored
58 $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) \
59 $(foreach dir,$(DIRS),$(DISTCLEANSUFFIXES:%=$(SUBDIR)$(dir)/%))
0c8cc2c @mansr Reorder some make rules
mansr authored
60
71c61f6 @mansr non-recursive makefiles
mansr authored
61 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
63611f3 @mansr Prettify make output
mansr authored
62 $(Q)mkdir -p "$(SHLIBDIR)"
2f138f0 @mansr build: clean up library installation rules
mansr authored
63 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
5d1b39f @michaelni Merge remote-tracking branch 'qatar/master'
michaelni authored
64 $$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
2f138f0 @mansr build: clean up library installation rules
mansr authored
65 $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
66 $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
67 $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
68 $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
63611f3 @mansr Prettify make output
mansr authored
69
71c61f6 @mansr non-recursive makefiles
mansr authored
70 install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
63611f3 @mansr Prettify make output
mansr authored
71 $(Q)mkdir -p "$(LIBDIR)"
fd676de @mansr Add INSTALL makefile variable
mansr authored
72 $$(INSTALL) -m 644 $$< "$(LIBDIR)"
6cfac0e @mansr Fix make install
mansr authored
73 $(LIB_INSTALL_EXTRA_CMD)
71c61f6 @mansr non-recursive makefiles
mansr authored
74
34512bc @mansr Split install-headers target and simplify rules
mansr authored
75 install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
63611f3 @mansr Prettify make output
mansr authored
76 $(Q)mkdir -p "$(INCINSTDIR)"
34512bc @mansr Split install-headers target and simplify rules
mansr authored
77 $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
78
79 install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
63611f3 @mansr Prettify make output
mansr authored
80 $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
34512bc @mansr Split install-headers target and simplify rules
mansr authored
81 $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
82
83 uninstall-libs::
50e10cb @mansr Use $(RM) to delete files
mansr authored
84 -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
85 "$(SHLIBDIR)/$(SLIBNAME)" \
86 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
2f138f0 @mansr build: clean up library installation rules
mansr authored
87 -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
88 -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
50e10cb @mansr Use $(RM) to delete files
mansr authored
89 -$(RM) "$(LIBDIR)/$(LIBNAME)"
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
90
91 uninstall-headers::
d42dce7 @cehoyos Remove avconfig.h and INCINSTDIRs on uninstall.
cehoyos authored
92 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS)) $(addprefix "$(INCINSTDIR)/",$(BUILT_HEADERS))
50e10cb @mansr Use $(RM) to delete files
mansr authored
93 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
d42dce7 @cehoyos Remove avconfig.h and INCINSTDIRs on uninstall.
cehoyos authored
94 -rmdir "$(INCINSTDIR)"
71c61f6 @mansr non-recursive makefiles
mansr authored
95 endef
96
97 $(eval $(RULES))
3fd422f @mansr Move make rules applicable only to subdirs into subdir.mak
mansr authored
98
28e1c97 @mansr build: rework rules for things in the tools dir
mansr authored
99 $(EXAMPLES) $(TESTPROGS) $(TOOLS): $(THIS_LIB) $(DEP_LIBS)
bbba084 @mansr Make examples and test progs depend on libraries
mansr authored
100
3fd422f @mansr Move make rules applicable only to subdirs into subdir.mak
mansr authored
101 examples: $(EXAMPLES)
102 testprogs: $(TESTPROGS)
Something went wrong with that request. Please try again.