Makefile 3.7 KB

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