2 # common bits used by all libraries
5 SRC_DIR
= $(SRC_PATH
)/lib
$(NAME
)
8 SRCS
:= $(OBJS
:.o
=.c
) $(ASM_OBJS
:.o
=.S
) $(CPPOBJS
:.o
=.
cpp)
9 OBJS
:= $(OBJS
) $(ASM_OBJS
) $(CPPOBJS
)
10 STATIC_OBJS
:= $(OBJS
) $(STATIC_OBJS
)
11 SHARED_OBJS
:= $(OBJS
) $(SHARED_OBJS
)
13 all: $(EXTRADEPS
) $(LIB
) $(SLIBNAME
)
15 $(LIB
): $(STATIC_OBJS
)
17 $(AR
) rc
$@
$^
$(EXTRAOBJS
)
20 $(SLIBNAME
): $(SLIBNAME_WITH_MAJOR
)
23 $(SLIBNAME_WITH_MAJOR
): $(SHARED_OBJS
)
24 $(CC
) $(SHFLAGS
) $(LDFLAGS
) -o
$@
$^
$(EXTRALIBS
) $(EXTRAOBJS
)
25 ifeq ($(CONFIG_MINGW
),yes
)
26 -lib
/machine
:i386
/def
:$(@
:.dll
=.def
)
30 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
33 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
35 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
37 g
++ $(subst -Wall
,,$(CFLAGS
)) -c
-o
$@
$<
40 $(CC
) -MM
$(CFLAGS
) $^
1>.depend
45 rm -f
*.o
*.d
*~
*.a
*.lib
*.so
*.so.
* *.dylib
*.dll \
46 *.lib
*.def
*.dll.a
*.exp
51 ifeq ($(BUILD_SHARED
),yes
)
52 INSTLIBTARGETS
+= install-lib-shared
54 ifeq ($(BUILD_STATIC
),yes
)
55 INSTLIBTARGETS
+= install-lib-static
58 install: install-libs install-headers
60 install-libs
: $(INSTLIBTARGETS
)
62 install-lib-shared
: $(SLIBNAME
)
63 install -d
"$(libdir)"
64 ifeq ($(CONFIG_MINGW
),yes
)
65 install $(INSTALLSTRIP
) -m
755 $(SLIBNAME
) "$(prefix)"
67 install $(INSTALLSTRIP
) -m
755 $(SLIBNAME
) \
68 $(shlibdir
)/$(SLIBNAME_WITH_VERSION
)
69 ln
-sf
$(SLIBNAME_WITH_VERSION
) \
70 $(shlibdir
)/$(SLIBNAME_WITH_MAJOR
)
71 ln
-sf
$(SLIBNAME_WITH_VERSION
) \
72 $(shlibdir
)/$(SLIBNAME
)
75 install-lib-static
: $(LIB
)
76 install -d
"$(libdir)"
77 install -m
644 $(LIB
) "$(libdir)"
80 install -d
"$(incdir)"
81 install -d
"$(libdir)/pkgconfig"
82 install -m
644 $(addprefix "$(SRC_DIR)"/,$(HEADERS
)) "$(incdir)"
83 install -m
644 $(BUILD_ROOT
)/lib
$(NAME
).
pc "$(libdir)/pkgconfig"
85 uninstall: uninstall-libs uninstall-headers
88 ifeq ($(CONFIG_MINGW
),yes
)
89 -rm -f
$(prefix)/$(SLIBNAME
)
91 -rm -f
$(libdir)/$(SLIBNAME_WITH_MAJOR
) \
92 $(libdir)/$(SLIBNAME
) \
93 $(libdir)/$(SLIBNAME_WITH_VERSION
)
95 -rm -f
$(libdir)/$(LIB
)
98 rm -f
$(addprefix $(incdir
)/,$(HEADERS
))
99 rm -f
$(libdir)/pkgconfig
/lib
$(NAME
).
pc
102 # include dependency files if they exist
104 ifneq ($(wildcard .depend
),)