2 # common bits used by all libraries
5 SRC_DIR
= $(SRC_PATH
)/$(SUBDIR
)
8 #FIXME: This should be in configure/config.mak
9 ifeq ($(CONFIG_WIN32
),yes
)
10 LDFLAGS
= -Wl
,--output-def
,$(@
:.dll
=.def
),--out-implib
,lib
$(SLIBNAME
:$(SLIBSUF
)=.dll.a
)
13 ifeq ($(TARGET_GPROF
),yes
)
18 #FIXME: This should be in configure/config.mak
19 ifeq ($(TARGET_ARCH_SPARC64
),yes
)
20 CFLAGS
+= -mcpu
=ultrasparc
-mtune
=ultrasparc
23 SRCS
:= $(OBJS
:.o
=.c
) $(ASM_OBJS
:.o
=.S
) $(CPPOBJS
:.o
=.
cpp)
24 OBJS
:= $(OBJS
) $(ASM_OBJS
) $(CPPOBJS
)
25 STATIC_OBJS
:= $(OBJS
) $(STATIC_OBJS
)
26 SHARED_OBJS
:= $(OBJS
) $(SHARED_OBJS
)
28 all: $(EXTRADEPS
) $(LIB
) $(SLIBNAME
)
30 $(LIB
): $(STATIC_OBJS
)
32 $(AR
) rc
$@
$^
$(EXTRAOBJS
)
35 $(SLIBNAME
): $(SLIBNAME_WITH_MAJOR
)
38 $(SLIBNAME_WITH_MAJOR
): $(SHARED_OBJS
)
39 $(CC
) $(SHFLAGS
) $(LDFLAGS
) -o
$@
$^
$(EXTRALIBS
) $(EXTRAOBJS
)
40 ifeq ($(CONFIG_WIN32
),yes
)
41 -lib
/machine
:i386
/def
:$(@
:.dll
=.def
)
45 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
48 $(CC
) $(CFLAGS
) $(LIBOBJFLAGS
) -c
-o
$@
$<
50 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
52 g
++ $(subst -Wall
,,$(CFLAGS
)) -c
-o
$@
$<
55 $(CC
) -MM
$(CFLAGS
) $^
1>.depend
60 rm -f
*.o
*.d
*~
*.a
*.lib
*.so
*.dylib
*.dll \
61 *.lib
*.def
*.dll.a
*.exp
66 ifeq ($(BUILD_SHARED
),yes
)
67 INSTLIBTARGETS
+= install-lib-shared
69 ifeq ($(BUILD_STATIC
),yes
)
70 INSTLIBTARGETS
+= install-lib-static
73 install: install-libs install-headers
75 install-libs
: $(INSTLIBTARGETS
)
77 install-lib-shared
: $(SLIBNAME
)
78 install -d
"$(libdir)"
79 ifeq ($(CONFIG_WIN32
),yes
)
80 install $(INSTALLSTRIP
) -m
755 $(SLIBNAME
) "$(prefix)"
82 install $(INSTALLSTRIP
) -m
755 $(SLIBNAME
) \
83 $(libdir)/$(SLIBNAME_WITH_VERSION
)
84 ln
-sf
$(SLIBNAME_WITH_VERSION
) \
85 $(libdir)/$(SLIBNAME_WITH_MAJOR
)
86 ln
-sf
$(SLIBNAME_WITH_VERSION
) \
90 install-lib-static
: $(LIB
)
91 install -d
"$(libdir)"
92 install -m
644 $(LIB
) "$(libdir)"
95 install -d
"$(incdir)"
96 install -d
"$(libdir)/pkgconfig"
97 install -m
644 $(addprefix "$(SRC_DIR)"/,$(HEADERS
)) "$(incdir)"
98 install -m
644 $(BUILD_ROOT
)/lib
$(NAME
).
pc "$(libdir)/pkgconfig"
100 uninstall: uninstall-libs uninstall-headers
103 ifeq ($(CONFIG_WIN32
),yes
)
104 -rm -f
$(prefix)/$(SLIBNAME
)
106 -rm -f
$(libdir)/$(SLIBNAME_WITH_MAJOR
) \
107 $(libdir)/$(SLIBNAME
) \
108 $(libdir)/$(SLIBNAME_WITH_VERSION
)
110 -rm -f
$(libdir)/$(LIB
)
113 rm -f
$(addprefix $(incdir
)/,$(HEADERS
))
114 rm -f
$(libdir)/pkgconfig
/lib
$(NAME
).
pc
117 # include dependency files if they exist
119 ifneq ($(wildcard .depend
),)