source: roaraudio/build-system/Makefile.library @ 5783:a6350ef51c51

Last change on this file since 5783:a6350ef51c51 was 5783:a6350ef51c51, checked in by phi, 11 years ago

added support to build libs as well as tools

File size: 2.2 KB
Line 
1#     Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2012
2#
3# This file is part of roard a part of RoarAudio,
4# a cross-platform sound system for both, home and professional use.
5# See README for details.
6#
7# This file is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 3
9# as published by the Free Software Foundation.
10#
11# RoarAudio is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this software; see the file COPYING.  If not, write to
18# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19# Boston, MA 02110-1301, USA.
20
21RABS_INSTALL_TARGETS += lib
22
23CFLAGS      += $(fPIC) $(SHARED_CF)
24LDFLAGS     += $(SHARED)
25
26SOVERSION   ?= dummy
27
28PC_VERSION  ?= so$(SOVERSION)
29PC_DESC     ?= DUMMY
30PC_LIBS     += libroar
31
32LIBNAME      = lib$(BASENAME)
33SOLIBNAME    = $(LIBNAME)$(SHARED_SUFFIX)
34SOVLIBNAME   = $(SOLIBNAME).$(SOVERSION)
35ALIBNAME     = $(LIBNAME).a
36PCLIBNAME    = $(LIBNAME).pc
37
38TARGETS=$(SOLIBNAME) $(SOVLIBNAME) $(ALIBNAME) $(PCLIBNAME)
39
40include $(ROAR_BUILDSYSTEM_DIR)/Makefile.common
41include $(ROAR_BUILDSYSTEM_DIR)/Makefile.install
42
43$(SOLIBNAME): $(SOVLIBNAME)
44        ln -fs $(SOVLIBNAME) $(SOLIBNAME)
45$(SOVLIBNAME): $(OBJS)
46        $(CC) $(LDFLAGS) -Wl,-soname,$(SOVLIBNAME) -o $(SOVLIBNAME) $(OBJS) $(LIBS)
47$(ALIBNAME): $(OBJS)
48        $(AR) cru $(ALIBNAME) $(OBJS)
49        $(RANLIB) $(ALIBNAME)
50$(PCLIBNAME):
51        echo 'prefix=$(PREFIX)' > $(PCLIBNAME)
52        echo 'exec_prefix=$${prefix}' >> $(PCLIBNAME)
53        echo 'libdir=$(PREFIX_LIB)' >> $(PCLIBNAME)
54        echo 'includedir=$(PREFIX_INC)' >> $(PCLIBNAME)
55        echo '' >> $(PCLIBNAME)
56        echo 'Name: $(LIBNAME)' >> $(PCLIBNAME)
57        echo 'Description: $(PC_DESC)' >> $(PCLIBNAME)
58        echo 'Version: $(PC_VERSION)' >> $(PCLIBNAME)
59        echo 'Conflicts:' >> $(PCLIBNAME)
60ifeq ($(LINK_DEPS),full)
61        echo 'Requires: $(PC_LIBS)' >> $(PCLIBNAME)
62else
63        echo 'Requires.private: $(PC_LIBS)' >> $(PCLIBNAME)
64endif
65        echo 'Libs: -L$${libdir} -l$(BASENAME)' >> $(PCLIBNAME)
66        echo 'Cflags: -I$${includedir}' >> $(PCLIBNAME)
Note: See TracBrowser for help on using the repository browser.