2 # common bits used by all libraries
5 SRC_DIR = $(SRC_PATH)/lib$(NAME)
8 ifeq ($(TARGET_GPROF),yes)
13 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
14 OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
15 STATIC_OBJS := $(OBJS) $(STATIC_OBJS)
16 SHARED_OBJS := $(OBJS) $(SHARED_OBJS)
18 all: $(EXTRADEPS) $(LIB) $(SLIBNAME)
20 $(LIB): $(STATIC_OBJS)
22 $(AR) rc $@ $^ $(EXTRAOBJS)
25 $(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
28 $(SLIBNAME_WITH_MAJOR): $(SHARED_OBJS)
29 $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
30 ifeq ($(CONFIG_WIN32),yes)
31 -lib /machine:i386 /def:$(@:.dll=.def)
35 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
38 $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
40 # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
42 g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
45 $(CC) -MM $(CFLAGS) $^ 1>.depend
50 rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
51 *.lib *.def *.dll.a *.exp
56 ifeq ($(BUILD_SHARED),yes)
57 INSTLIBTARGETS += install-lib-shared
59 ifeq ($(BUILD_STATIC),yes)
60 INSTLIBTARGETS += install-lib-static
63 install: install-libs install-headers
65 install-libs: $(INSTLIBTARGETS)
67 install-lib-shared: $(SLIBNAME)
68 install -d "$(libdir)"
69 ifeq ($(CONFIG_WIN32),yes)
70 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
72 install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
73 $(libdir)/$(SLIBNAME_WITH_VERSION)
74 ln -sf $(SLIBNAME_WITH_VERSION) \
75 $(libdir)/$(SLIBNAME_WITH_MAJOR)
76 ln -sf $(SLIBNAME_WITH_VERSION) \
80 install-lib-static: $(LIB)
81 install -d "$(libdir)"
82 install -m 644 $(LIB) "$(libdir)"
85 install -d "$(incdir)"
86 install -d "$(libdir)/pkgconfig"
87 install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(incdir)"
88 install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(libdir)/pkgconfig"
90 uninstall: uninstall-libs uninstall-headers
93 ifeq ($(CONFIG_WIN32),yes)
94 -rm -f $(prefix)/$(SLIBNAME)
96 -rm -f $(libdir)/$(SLIBNAME_WITH_MAJOR) \
97 $(libdir)/$(SLIBNAME) \
98 $(libdir)/$(SLIBNAME_WITH_VERSION)
100 -rm -f $(libdir)/$(LIB)
103 rm -f $(addprefix $(incdir)/,$(HEADERS))
104 rm -f $(libdir)/pkgconfig/lib$(NAME).pc
107 # include dependency files if they exist
109 ifneq ($(wildcard .depend),)