Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 102 lines (76 sloc) 3.361 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
755834e @DonDiego build: Rename YASMDEP variable to DEPYASM for consistency
DonDiego authored
20 $(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
8c5239b @mansr Move some make rules outside of eval'd block
mansr authored
21 $(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
22
11a1033 @michaelni Merge remote-tracking branch 'qatar/master'
michaelni authored
23 $(OBJS) $(OBJS:.o=.s) $(SUBDIR)%.h.o $(TESTOBJS): CPPFLAGS += -DHAVE_AV_CONFIG_H
659aa20 @mansr build: improve rules for test programs
mansr authored
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) $@
3dbc777 @mansr build: support some non-standard ar variants
mansr authored
28 $(AR) $(ARFLAGS) $(AR_O) $^ $(EXTRAOBJS)
71c61f6 @mansr non-recursive makefiles
mansr authored
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
8db73c6 @mansr build: allow non-standard variations of linker -l/-L flags
mansr authored
38 $$(LD) $(LDFLAGS) $$(LD_O) $$^ $(FULLNAME:%=$(LD_LIB)) $(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)
8f7c26e @DonDiego build: Use portable abstraction for linker/hostcc output file syntax
DonDiego authored
45 $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_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)) \
e7e19b1 @DonDiego build: Only clean the architecture subdirectory we build for.
DonDiego authored
54 $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(HOSTOBJS) $(HOSTPROGS)
0c8cc2c @mansr Reorder some make rules
mansr authored
55
56 distclean:: clean
e7e19b1 @DonDiego build: Only clean the architecture subdirectory we build for.
DonDiego authored
57 $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
0c8cc2c @mansr Reorder some make rules
mansr authored
58
71c61f6 @mansr non-recursive makefiles
mansr authored
59 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
63611f3 @mansr Prettify make output
mansr authored
60 $(Q)mkdir -p "$(SHLIBDIR)"
2f138f0 @mansr build: clean up library installation rules
mansr authored
61 $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
5d1b39f @michaelni Merge remote-tracking branch 'qatar/master'
michaelni authored
62 $$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
2f138f0 @mansr build: clean up library installation rules
mansr authored
63 $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
64 $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
65 $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
66 $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
63611f3 @mansr Prettify make output
mansr authored
67
71c61f6 @mansr non-recursive makefiles
mansr authored
68 install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
63611f3 @mansr Prettify make output
mansr authored
69 $(Q)mkdir -p "$(LIBDIR)"
fd676de @mansr Add INSTALL makefile variable
mansr authored
70 $$(INSTALL) -m 644 $$< "$(LIBDIR)"
6cfac0e @mansr Fix make install
mansr authored
71 $(LIB_INSTALL_EXTRA_CMD)
71c61f6 @mansr non-recursive makefiles
mansr authored
72
34512bc @mansr Split install-headers target and simplify rules
mansr authored
73 install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
63611f3 @mansr Prettify make output
mansr authored
74 $(Q)mkdir -p "$(INCINSTDIR)"
34512bc @mansr Split install-headers target and simplify rules
mansr authored
75 $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
76
77 install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
63611f3 @mansr Prettify make output
mansr authored
78 $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
34512bc @mansr Split install-headers target and simplify rules
mansr authored
79 $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
80
81 uninstall-libs::
50e10cb @mansr Use $(RM) to delete files
mansr authored
82 -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
83 "$(SHLIBDIR)/$(SLIBNAME)" \
84 "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
4944085 @jamrial build: Fix some paths in uninstall-libs
jamrial authored
85 -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
86 -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
50e10cb @mansr Use $(RM) to delete files
mansr authored
87 -$(RM) "$(LIBDIR)/$(LIBNAME)"
d3cb93b @ramiropolla Revert r21226, it was a joke:
ramiropolla authored
88
89 uninstall-headers::
a2b4d1d @DonDiego build: Remove all installed headers and header directories on uninstall
DonDiego authored
90 $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
50e10cb @mansr Use $(RM) to delete files
mansr authored
91 $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
d42dce7 @cehoyos Remove avconfig.h and INCINSTDIRs on uninstall.
cehoyos authored
92 -rmdir "$(INCINSTDIR)"
71c61f6 @mansr non-recursive makefiles
mansr authored
93 endef
94
95 $(eval $(RULES))
3fd422f @mansr Move make rules applicable only to subdirs into subdir.mak
mansr authored
96
28e1c97 @mansr build: rework rules for things in the tools dir
mansr authored
97 $(EXAMPLES) $(TESTPROGS) $(TOOLS): $(THIS_LIB) $(DEP_LIBS)
0ea5b44 @mansr build: link test programs with static libraries
mansr authored
98 $(TESTPROGS): $(SUBDIR)$(LIBNAME)
bbba084 @mansr Make examples and test progs depend on libraries
mansr authored
99
3fd422f @mansr Move make rules applicable only to subdirs into subdir.mak
mansr authored
100 examples: $(EXAMPLES)
101 testprogs: $(TESTPROGS)
Something went wrong with that request. Please try again.