Makefile 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # Copyright (c) 2002-2006 MontaVista Software, Inc.
  2. # Copyright (c) 2006 Sun Microsystems, Inc.
  3. # Copyright (c) 2006-2008 Red Hat, Inc.
  4. #
  5. # All rights reserved.
  6. #
  7. # This software licensed under BSD license, the text of which follows:
  8. #
  9. # Redistribution and use in source and binary forms, with or without
  10. # modification, are permitted provided that the following conditions are met:
  11. #
  12. # - Redistributions of source code must retain the above copyright notice,
  13. # this list of conditions and the following disclaimer.
  14. # - Redistributions in binary form must reproduce the above copyright notice,
  15. # this list of conditions and the following disclaimer in the documentation
  16. # and/or other materials provided with the distribution.
  17. # - Neither the name of the MontaVista Software, Inc. nor the names of its
  18. # contributors may be used to endorse or promote products derived from this
  19. # software without specific prior written permission.
  20. #
  21. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  22. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  25. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  26. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  27. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  28. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  29. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  30. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  31. # THE POSSIBILITY OF SUCH DAMAGE.
  32. # Include configuration
  33. #
  34. srcdir ?= $(CURDIR)/../
  35. include $(srcdir)Makefile.inc
  36. override CFLAGS += -I$(srcdir)include
  37. LDFLAGS += -L./
  38. ifeq (${OPENAIS_COMPAT}, LINUX)
  39. override LDFLAGS += -ldl
  40. endif
  41. ifeq (${OPENAIS_COMPAT}, SOLARIS)
  42. override LDFLAGS += -lnsl -lsocket -lrt
  43. endif
  44. # AMF objects
  45. AMF_SRC = amf.c amfutil.c amfnode.c amfcluster.c amfapp.c amfsg.c amfsu.c amfcomp.c amfsi.c
  46. AMF_OBJS = amf.o amfutil.o amfnode.o amfcluster.o amfapp.o amfsg.o amfsu.o amfcomp.o amfsi.o
  47. # LCR objects
  48. LCR_SRC = openaisparser.c clm.c ckpt.c evt.c lck.c msg.c cfg.c openaisparser.c $(AMF_SRC)
  49. LCR_OBJS = openaisparser.o clm.o ckpt.o evt.o lck.o msg.o cfg.o openaisparser.o $(AMF_OBJS)
  50. override CFLAGS += -fPIC
  51. all: openaisparser.lcrso service_clm.lcrso service_ckpt.lcrso \
  52. service_evt.lcrso service_lck.lcrso service_msg.lcrso \
  53. openais-instantiate
  54. ifeq (${OPENAIS_COMPAT}, DARWIN)
  55. service_evs.lcrso: evs.o
  56. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load evs.o -o $@
  57. service_clm.lcrso: clm.o
  58. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load clm.o -o $@
  59. service_amf.lcrso: $(AMF_OBJS)
  60. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load $(AMF_OBJS) -o $@
  61. service_ckpt.lcrso: ckpt.o
  62. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load ckpt.o -o $@
  63. service_evt.lcrso: evt.o
  64. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load evt.o -o $@
  65. service_lck.lcrso: lck.o
  66. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load lck.o -o $@
  67. service_msg.lcrso: msg.o
  68. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load msg.o -o $@
  69. service_cfg.lcrso: cfg.o
  70. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load cfg.o -o $@
  71. openaisparser.lcrso: openaisparser.o
  72. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load openaisparser.o -o $@
  73. vsf_ykd.lcrso: vsf_ykd.o
  74. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load vsf_ykd.o -o $@
  75. else
  76. service_clm.lcrso: clm.o
  77. $(CC) -shared -Wl,-soname,service_clm.lcrso clm.o -o $@
  78. service_amf.lcrso: $(AMF_OBJS)
  79. $(CC) -shared -Wl,-soname,service_amf.lcrso $(AMF_OBJS) -o $@
  80. service_ckpt.lcrso: ckpt.o
  81. $(CC) -shared -Wl,-soname,service_ckpt.lcrso ckpt.o -o $@
  82. service_evt.lcrso: evt.o
  83. $(CC) -shared -Wl,-soname,service_evt.lcrso evt.o -o $@
  84. service_lck.lcrso: lck.o
  85. $(CC) -shared -Wl,-soname,service_lck.lcrso lck.o -o $@
  86. service_msg.lcrso: msg.o
  87. $(CC) -shared -Wl,-soname,service_msg.lcrso msg.o -o $@
  88. service_cfg.lcrso: cfg.o
  89. $(CC) -shared -Wl,-soname,service_cfg.lcrso cfg.o -o $@
  90. openaisparser.lcrso: openaisparser.o
  91. $(CC) -shared -Wl,-soname,openaisparser.lcrso openaisparser.o -o $@
  92. vsf_ykd.lcrso: vsf_ykd.o
  93. $(CC) -shared -Wl,-soname,vsf_ykd.lcrso vsf_ykd.o -o $@
  94. endif
  95. keygen: keygen.o
  96. $(CC) $(LDFLAGS) keygen.o -o keygen
  97. openais-instantiate: openais-instantiate.o
  98. $(CC) $(LDFLAGS) openais-instantiate.o -o openais-instantiate
  99. clean:
  100. rm -f aisexec $(OBJS) *.o *.lcrso libtotem_pg.so* libtotem_pg.a gmon.out
  101. rm -f keygen keygen.o openais-instantiate *.da *.bb *.bbg liblogsys.so* liblogsys.a
  102. depend:
  103. makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(EXEC_SRC) $(TOTEM_SRC) $(LOGSYS_SRC) $(LCR_SRC) > /dev/null 2>&1
  104. # - fPIC rules required for service handler shared objects
  105. ../lcr/lcr_ifact.o: ../lcr/lcr_ifact.c
  106. $(CC) $(CFLAGS) $(CPPFLAGS) -DPREFIX='"$(PREFIX)"' -DLCRSODIR='"$(LCRSODIR)"' -I../lcr -c -o $@ ../lcr/lcr_ifact.c
  107. clm.o: clm.c
  108. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
  109. amf.o: amf.c
  110. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
  111. ckpt.o: ckpt.c
  112. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
  113. evt.o: evt.c
  114. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
  115. lck.o: lck.c
  116. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
  117. msg.o: msg.c
  118. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
  119. openaisparser.o: openaisparser.c
  120. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<