4
0

Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. libquorum.a libquorum.so.2.0.0 \
  41. libpload.a libpload.so.2.0.0 \
  42. libcoroutil.a libcoroutil.so.2.0.0
  43. libcoroutil.a: util.o
  44. $(AR) -rc libcoroutil.a util.o
  45. ifeq (${COROSYNC_COMPAT}, DARWIN)
  46. DARWIN_OPTS=-dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0
  47. libcoroutil.so.2.0.0: util.o
  48. $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o -o $@
  49. libevs.so.2.0.0: util.o evs.o
  50. $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o evs.o -o $@
  51. libcpg.so.2.0.0: util.o cpg.o
  52. $(CC) $(DARWIN_OPTS) util.o cpg.o -o $@
  53. libquorum.so.2.0.0: util.o quorum.o
  54. $(CC) $(DARWIN_OPTS) util.o quorum.o -o $@
  55. libconfdb.so.2.0.0: util.o confdb.o sa-confdb.o
  56. $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@
  57. libcfg.so.2.0.0: util.o cfg.o
  58. $(CC) $(DARWIN_OPTS) util.o cfg.o -o $@
  59. libpload.so.2.0.0: util.o pload.o
  60. $(CC) $(DARWIN_OPTS) util.o pload.o -o $@
  61. else
  62. libcoroutil.so.2.0.0: util.o
  63. $(CC) $(LDFLAGS) -shared -Wl,-soname,libcoroutil.so.2,-version-script=$(srcdir)$(subdir)libcoroutil.versions util.o -o $@
  64. libevs.so.2.0.0: util.o evs.o
  65. $(CC) $(LDFLAGS) -shared -Wl,-soname,libevs.so.2,-version-script=$(srcdir)$(subdir)libevs.versions util.o evs.o -o $@
  66. libcpg.so.2.0.0: util.o cpg.o
  67. $(CC) -shared -Wl,-soname,libcpg.so.2,-version-script=$(srcdir)$(subdir)libcpg.versions util.o cpg.o -o $@
  68. libquorum.so.2.0.0: util.o quorum.o
  69. $(CC) -shared -Wl,-soname,libquorum.so.2,-version-script=$(srcdir)$(subdir)libquorum.versions util.o quorum.o -o $@
  70. libconfdb.so.2.0.0: util.o confdb.o sa-confdb.o
  71. $(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 $@
  72. libcfg.so.2.0.0: util.o cfg.o
  73. $(CC) -shared -Wl,-soname,libcfg.so.2,-version-script=$(srcdir)$(subdir)libcfg.versions util.o cfg.o -o $@
  74. libpload.so.2.0.0: util.o pload.o
  75. $(CC) -shared -Wl,-soname,libpload.so.2,-version-script=$(srcdir)$(subdir)libpload.versions util.o cfg.o -o $@
  76. endif
  77. libevs.a: util.o evs.o
  78. $(AR) -rc libevs.a util.o evs.o
  79. libcpg.a: util.o cpg.o
  80. $(AR) -rc libcpg.a util.o cpg.o
  81. libquorum.a: util.o quorum.o
  82. $(AR) -rc libquorum.a util.o quorum.o
  83. libconfdb.a: util.o confdb.o sa-confdb.o
  84. $(AR) -rc libconfdb.a util.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o
  85. libcfg.a: util.o cfg.o
  86. $(AR) -rc libcfg.a util.o cfg.o
  87. libpload.a: util.o pload.o
  88. $(AR) -rc libpload.a util.o pload.o
  89. clean:
  90. rm -f *.o *.a *.so* *.da *.bb *.bbg
  91. lint:
  92. -splint $(LINT_FLAGS) $(CFLAGS) *.c
  93. # -fPIC rules required for all libraries
  94. %.o: %.c
  95. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
  96. depend:
  97. makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(LIBAIS_SRC) > /dev/null 2>&1