Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Copyright (c) 2002-2005 MontaVista Software, Inc.
  2. #
  3. # All rights reserved.
  4. #
  5. # This software licensed under BSD license, the text of which follows:
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions are met:
  9. #
  10. # - Redistributions of source code must retain the above copyright notice,
  11. # this list of conditions and the following disclaimer.
  12. # - Redistributions in binary form must reproduce the above copyright notice,
  13. # this list of conditions and the following disclaimer in the documentation
  14. # and/or other materials provided with the distribution.
  15. # - Neither the name of the MontaVista Software, Inc. nor the names of its
  16. # contributors may be used to endorse or promote products derived from this
  17. # software without specific prior written permission.
  18. #
  19. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  20. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  23. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  29. # THE POSSIBILITY OF SUCH DAMAGE.
  30. # Include configuration
  31. #
  32. srcdir ?= $(CURDIR)/../
  33. subdir ?= lib/
  34. include $(srcdir)Makefile.inc
  35. override LDFLAGS += -L./
  36. all: libcpg.a libcpg.so.2.0.0 \
  37. libconfdb.a libconfdb.so.2.0.0 \
  38. libevs.a libevs.so.2.0.0 \
  39. libcfg.a libcfg.so.2.0.0 \
  40. libcoroutil.a libcoroutil.so.2.0.0
  41. libcoroutil.a: util.o
  42. $(AR) -rc libcoroutil.a util.o
  43. ifeq (${OPENAIS_COMPAT}, DARWIN)
  44. DARWIN_OPTS=-dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0
  45. libcoroutil.so.2.0.0: util.o
  46. $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o -o $@
  47. libevs.so.2.0.0: util.o evs.o
  48. $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o evs.o -o $@
  49. libcpg.so.2.0.0: util.o cpg.o
  50. $(CC) $(DARWIN_OPTS) util.o cpg.o -o $@
  51. libconfdb.so.2.0.0: util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o
  52. $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
  53. libcfg.so.2.0.0: util.o cfg.o
  54. $(CC) $(DARWIN_OPTS) util.o cfg.o -o $@
  55. libcpg.so.2.0.0: util.o cpg.o
  56. $(CC) $(DARWIN_OPTS) util.o cpg.o -o $@
  57. else
  58. libcoroutil.so.2.0.0: util.o
  59. $(CC) $(LDFLAGS) -shared -Wl,-soname,libcoroutil.so.2,-version-script=$(srcdir)$(subdir)libcoroutil.versions util.o -o $@
  60. libevs.so.2.0.0: util.o evs.o
  61. $(CC) $(LDFLAGS) -shared -Wl,-soname,libevs.so.2,-version-script=$(srcdir)$(subdir)libevs.versions util.o evs.o -o $@
  62. libcpg.so.2.0.0: util.o cpg.o
  63. $(CC) -shared -Wl,-soname,libcpg.so.2,-version-script=$(srcdir)$(subdir)libcpg.versions util.o cpg.o -o $@
  64. libconfdb.so.2.0.0: util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o
  65. $(CC) $(LDFLAGS) -shared -Wl,-soname,libconfdb.so.2,-version-script=$(srcdir)$(subdir)libconfdb.versions util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
  66. libcfg.so.2.0.0: util.o cfg.o
  67. $(CC) -shared -Wl,-soname,libcfg.so.2,-version-script=$(srcdir)$(subdir)libcfg.versions util.o cfg.o -o $@
  68. endif
  69. libevs.a: util.o evs.o
  70. $(AR) -rc libevs.a util.o evs.o
  71. libcpg.a: util.o cpg.o
  72. $(AR) -rc libcpg.a util.o cpg.o
  73. libconfdb.a: util.o confdb.o sa-confdb.o
  74. $(AR) -rc libconfdb.a util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o
  75. libcfg.a: util.o cfg.o
  76. $(AR) -rc libcfg.a util.o cfg.o
  77. clean:
  78. rm -f *.o libcfg.so* libcoroutil.so* libcoroutil.a \
  79. libevs.so* libevs.a libcpg.so* libcpg.a libcfg.a libconfdb.so* \
  80. libconfdb.a libconfdb.a \ *.da *.bb *.bbg
  81. # -fPIC rules required for all libraries
  82. %.o: %.c
  83. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
  84. depend:
  85. makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(LIBAIS_SRC) > /dev/null 2>&1