Makefile 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. # Copyright (c) 2002-2006 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. # BUILD_DYNAMIC can be defined to 1 to build for dynamic loading of service
  31. # handler modules. If the developer intends to debug, building without
  32. # dynamic modules should provide an easier route.
  33. BUILD_DYNAMIC=0
  34. # Production mode flags
  35. CFLAGS = -O3 -Wall -fomit-frame-pointer
  36. LDFLAGS = -lpthread -ldl
  37. # Debug mode flags
  38. #CFLAGS = -g -Wall
  39. #LDFLAGS = -g -lpthread -ldl
  40. # Profile mode flags
  41. #CFLAGS = -O3 -pg
  42. #LDFLAGS = -pg -lpthread
  43. # Code Coverage with lcov flgs
  44. #CFLAGS = -ftest-coverage -fprofile-arcs
  45. #LDFLAGS = -g
  46. # Totem objects
  47. TOTEM_SRC = aispoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c totemconfig.c tlist.c crypto.c wthread.c
  48. TOTEM_OBJS = aispoll.o totemip.o totemnet.o totemrrp.o totemsrp.o totemmrp.o totempg.o totemconfig.o tlist.o crypto.o wthread.o
  49. EXEC_LIBS = libtotem_pg.a
  50. # service handler objects
  51. SERV_SRC = evs.c clm.c amf.c ckpt.c evt.c lck.c msg.c cfg.c
  52. SERV_OBJS = evs.o clm.o amf.o ckpt.o evt.o lck.o msg.o cfg.o
  53. # main executive objects
  54. MAIN_SRC = main.c print.c mempool.c \
  55. util.c sync.c ykd.c mainconfig.c amfconfig.c
  56. MAIN_OBJS = main.o print.o mempool.o \
  57. util.o sync.o ykd.o mainconfig.o amfconfig.o ../lcr/lcr_ifact.o
  58. ifeq (${BUILD_DYNAMIC}, 1)
  59. EXEC_OBJS = $(TOTEM_OBJS) $(MAIN_OBJS)
  60. CFLAGS += -fPIC
  61. LDFLAGS += -rdynamic
  62. all:libtotem_pg.a libtotem_pg.so.1.0 ../lcr/lcr_ifact.o \
  63. service_evs.lcrso service_clm.lcrso service_amf.lcrso \
  64. service_ckpt.lcrso service_evt.lcrso service_lck.lcrso \
  65. service_msg.lcrso service_cfg.lcrso \
  66. aisexec keygen openais-instantiate
  67. else
  68. EXEC_OBJS = $(TOTEM_OBJS) $(MAIN_OBJS) $(SERV_OBJS)
  69. all: libtotem_pg.a aisexec keygen openais-instantiate
  70. endif
  71. service_evs.lcrso: evs.o
  72. $(CC) -shared -Wl,-soname,service_evs.lcrso evs.o -o $@
  73. service_clm.lcrso: clm.o
  74. $(CC) -shared -Wl,-soname,service_clm.lcrso clm.o -o $@
  75. service_amf.lcrso: amf.o
  76. $(CC) -shared -Wl,-soname,service_amf.lcrso amf.o -o $@
  77. service_ckpt.lcrso: ckpt.o
  78. $(CC) -shared -Wl,-soname,service_ckpt.lcrso ckpt.o -o $@
  79. service_evt.lcrso: evt.o
  80. $(CC) -shared -Wl,-soname,service_evt.lcrso evt.o -o $@
  81. service_lck.lcrso: lck.o
  82. $(CC) -shared -Wl,-soname,service_lck.lcrso lck.o -o $@
  83. service_msg.lcrso: msg.o
  84. $(CC) -shared -Wl,-soname,service_msg.lcrso msg.o -o $@
  85. service_cfg.lcrso: cfg.o
  86. $(CC) -shared -Wl,-soname,service_cfg.lcrso cfg.o -o $@
  87. aisexec: $(EXEC_OBJS) libtotem_pg.a
  88. $(CC) $(LDFLAGS) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec
  89. libtotem_pg.a: $(TOTEM_OBJS)
  90. $(AR) -rc libtotem_pg.a $(TOTEM_OBJS)
  91. libtotem_pg.so.1.0: $(TOTEM_OBJS)
  92. $(CC) -shared -Wl,-soname,libtotem_pg.so.1 $(TOTEM_OBJS) -o $@
  93. rm -f libtotem_pg.so.1 libtotem_pg.so
  94. ln -s libtotem_pg.so.1.0 libtotem_pg.so.1
  95. ln -s libtotem_pg.so.1.0 libtotem_pg.so
  96. keygen: keygen.o
  97. $(CC) $(LDFLAGS) keygen.o -o keygen
  98. openais-instantiate: openais-instantiate.o
  99. $(CC) $(LDFLAGS) openais-instantiate.o -o openais-instantiate
  100. clean:
  101. rm -f aisexec $(OBJS) *.o *.lcrso libtotem_pg.so.1.0 libtotem_pg.so.1 libtotem_pg.so libtotem_pg.a gmon.out keygen keygen.o openais-instantiate *.da *.bb *.bbg
  102. depend:
  103. makedepend -Y -- $(CFLAGS) $(EXEC_SRC) $(TOTEM_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) -I../lcr -c -o $@ ../lcr/lcr_ifact.c
  107. evs.o: evs.c
  108. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  109. clm.o: clm.c
  110. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  111. amf.o: amf.c
  112. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  113. ckpt.o: ckpt.c
  114. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  115. evt.o: evt.c
  116. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  117. lck.o: lck.c
  118. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  119. msg.o: msg.c
  120. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  121. cfg.o: cfg.c
  122. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  123. # -fPIC rules required for lib totem
  124. aispoll.o: aispoll.c
  125. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  126. totempg.o: totempg.c
  127. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  128. totemsrp.o: totemsrp.c
  129. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  130. totemrrp.o: totemrrp.c
  131. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  132. totemip.o: totemip.c
  133. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  134. totemnet.o: totemnet.c
  135. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  136. wthread.o: wthread.c
  137. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  138. tlist.o: tlist.c
  139. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  140. crypto.o: crypto.c
  141. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  142. totemmrp.o: totemmrp.c
  143. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  144. totemconfig.o: totemconfig.c
  145. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  146. # DO NOT DELETE
  147. main.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  148. main.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  149. main.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h amfconfig.h
  150. main.o: main.h ../include/saClm.h handlers.h
  151. main.o: ../include/saEvt.h swab.h print.h
  152. clm.o: ../include/saAis.h ../include/saClm.h ../include/saAis.h
  153. clm.o: ../include/ipc_evs.h ../include/saClm.h ../include/ipc_gen.h
  154. clm.o: ../include/ipc_clm.h ../include/list.h ../include/queue.h aispoll.h
  155. clm.o: totempg.h totemsrp.h amfconfig.h main.h handlers.h
  156. clm.o: ../include/saEvt.h mempool.h print.h
  157. amf.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  158. amf.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  159. amf.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h util.h
  160. amf.o: amfconfig.h main.h ../include/saClm.h handlers.h
  161. amf.o: ../include/saEvt.h print.h
  162. ckpt.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  163. ckpt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  164. ckpt.o: ../include/queue.h aispoll.h mempool.h util.h amfconfig.h totempg.h
  165. ckpt.o: totemsrp.h main.h ../include/saClm.h handlers.h
  166. ckpt.o: ../include/saEvt.h print.h
  167. evt.o: ../include/ipc_evt.h ../include/saAis.h ../include/saEvt.h
  168. evt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  169. evt.o: ../include/queue.h util.h ../include/saAis.h aispoll.h mempool.h
  170. evt.o: amfconfig.h totempg.h totemsrp.h main.h ../include/saClm.h
  171. evt.o: ../include/ipc_evs.h handlers.h
  172. evt.o: ../include/saEvt.h swab.h print.h
  173. evs.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  174. evs.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  175. evs.o: ../include/queue.h aispoll.h totempg.h totemsrp.h amfconfig.h main.h
  176. evs.o: ../include/saClm.h handlers.h
  177. evs.o: ../include/saEvt.h mempool.h print.h
  178. amfconfig.o: ../include/saAis.h ../include/list.h util.h amfconfig.h aispoll.h
  179. amfconfig.o: totempg.h totemsrp.h mempool.h print.h ../include/saClm.h
  180. amfconfig.o: ../include/saAis.h
  181. print.o: print.h ../include/saAis.h ../include/saClm.h
  182. print.o: ../include/saAis.h amfconfig.h ../include/list.h aispoll.h totempg.h
  183. print.o: totemsrp.h
  184. mempool.o: ../include/list.h mempool.h
  185. util.o: ../include/saAis.h ../include/list.h util.h
  186. aispoll.o: aispoll.h ../include/list.h ../include/saAis.h tlist.h
  187. totemsrp.o: aispoll.h totemsrp.h ../include/queue.h ../include/sq.h
  188. totemsrp.o: ../include/list.h ../include/saAis.h swab.h crypto.h
  189. totempg.o: totempg.h aispoll.h totemsrp.h swab.h
  190. tlist.o: ../include/list.h tlist.h
  191. hdb.o: ../include/saAis.h
  192. crypto.o: crypto.h