Makefile 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. # Include configuration
  31. #
  32. include ../Makefile.inc
  33. CFLAGS += -I../include
  34. LDFLAGS += -L./
  35. ifeq (${BUILD_DYNAMIC}, 1)
  36. LDFLAGS += ${DYFLAGS}
  37. endif
  38. ifeq (${OPENAIS_COMPAT}, LINUX)
  39. LDFLAGS += -ldl
  40. endif
  41. # OPENAIS_USER, OPENAIS_GROUP, OPENAIS_CONFDIR
  42. #
  43. CFLAGS += -DOPENAIS_USER=\"${OPENAIS_USER}\" -DOPENAIS_GROUP=\"${OPENAIS_GROUP}\" -DOPENAIS_CONFDIR=\"${OPENAIS_CONFDIR}\"
  44. # Totem objects
  45. TOTEM_SRC = aispoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c tlist.c crypto.c wthread.c
  46. TOTEM_OBJS = aispoll.o totemip.o totemnet.o totemrrp.o totemsrp.o totemmrp.o totempg.o tlist.o crypto.o wthread.o
  47. EXEC_LIBS = libtotem_pg.a
  48. # LCR objects
  49. LCR_SRC = evs.c clm.c amf.c ckpt.c evt.c lck.c msg.c cfg.c cpg.c amfconfig.c aisparser.c vsf_ykd.c
  50. LCR_OBJS = evs.o clm.o amf.o ckpt.o evt.o lck.o msg.o cfg.o cpg.o amfconfig.o aisparser.o vsf_ykd.o
  51. # main executive objects
  52. MAIN_SRC = main.c print.c mempool.c \
  53. util.c sync.c ykd.c service.c totemconfig.c mainconfig.c
  54. MAIN_OBJS = main.o print.o mempool.o \
  55. util.o sync.o service.o totemconfig.o mainconfig.o ../lcr/lcr_ifact.o
  56. OTHER_OBJS = objdb.o
  57. ifeq (${BUILD_DYNAMIC}, 1)
  58. EXEC_OBJS = $(TOTEM_OBJS) $(MAIN_OBJS)
  59. CFLAGS += -fPIC
  60. all:libtotem_pg.a libtotem_pg.so.1.0 ../lcr/lcr_ifact.o \
  61. aisexec \
  62. service_evs.lcrso service_clm.lcrso service_amf.lcrso \
  63. service_ckpt.lcrso service_evt.lcrso service_lck.lcrso \
  64. service_msg.lcrso service_cfg.lcrso service_cpg.lcrso \
  65. objdb.lcrso aisparser.lcrso vsf_ykd.lcrso keygen openais-instantiate
  66. else
  67. EXEC_OBJS = $(TOTEM_OBJS) $(MAIN_OBJS) $(OTHER_OBJS) $(LCR_OBJS)
  68. all: libtotem_pg.a aisexec keygen openais-instantiate
  69. endif
  70. ifeq (${OPENAIS_COMPAT}, DARWIN)
  71. service_evs.lcrso: evs.o
  72. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load evs.o -o $@
  73. service_clm.lcrso: clm.o
  74. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load clm.o -o $@
  75. service_amf.lcrso: amf.o amfconfig.o
  76. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load amf.o amfconfig.o -o $@
  77. service_ckpt.lcrso: ckpt.o
  78. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load ckpt.o -o $@
  79. service_evt.lcrso: evt.o
  80. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load evt.o -o $@
  81. service_lck.lcrso: lck.o
  82. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load lck.o -o $@
  83. service_msg.lcrso: msg.o
  84. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load msg.o -o $@
  85. service_cfg.lcrso: cfg.o
  86. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load cfg.o -o $@
  87. service_cpg.lcrso: cpg.o
  88. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load cpg.o -o $@
  89. aisparser.lcrso: aisparser.o
  90. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load aisparser.o -o $@
  91. objdb.lcrso: objdb.o
  92. $(CC) -bundle -bundle_loader ./aisexec -bind_at_load objdb.o -o $@
  93. vsf_ykd.lcrso: vsf_ykd.o
  94. $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load vsf_ykd.o -o $@
  95. else
  96. service_evs.lcrso: evs.o
  97. $(CC) -shared -Wl,-soname,service_evs.lcrso evs.o -o $@
  98. service_clm.lcrso: clm.o
  99. $(CC) -shared -Wl,-soname,service_clm.lcrso clm.o -o $@
  100. service_amf.lcrso: amf.o amfconfig.o
  101. $(CC) -shared -Wl,-soname,service_amf.lcrso amf.o amfconfig.o -o $@
  102. service_ckpt.lcrso: ckpt.o
  103. $(CC) -shared -Wl,-soname,service_ckpt.lcrso ckpt.o -o $@
  104. service_evt.lcrso: evt.o
  105. $(CC) -shared -Wl,-soname,service_evt.lcrso evt.o -o $@
  106. service_lck.lcrso: lck.o
  107. $(CC) -shared -Wl,-soname,service_lck.lcrso lck.o -o $@
  108. service_msg.lcrso: msg.o
  109. $(CC) -shared -Wl,-soname,service_msg.lcrso msg.o -o $@
  110. service_cfg.lcrso: cfg.o
  111. $(CC) -shared -Wl,-soname,service_cfg.lcrso cfg.o -o $@
  112. service_cpg.lcrso: cpg.o
  113. $(CC) -shared -Wl,-soname,service_cpg.lcrso cpg.o -o $@
  114. aisparser.lcrso: aisparser.o
  115. $(CC) -shared -Wl,-soname,aisparser.lcrso aisparser.o -o $@
  116. vsf_ykd.lcrso: vsf_ykd.o
  117. $(CC) -shared -Wl,-soname,vsf_ykd.lcrso vsf_ykd.o -o $@
  118. objdb.lcrso: objdb.o
  119. $(CC) -shared -Wl,-soname,objdb.lcrso objdb.o -o $@
  120. endif
  121. aisexec: $(EXEC_OBJS) libtotem_pg.a
  122. $(CC) $(LDFLAGS) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec
  123. libtotem_pg.a: $(TOTEM_OBJS)
  124. $(AR) -rc libtotem_pg.a $(TOTEM_OBJS)
  125. ifeq (${OPENAIS_COMPAT}, DARWIN)
  126. libtotem_pg.so.1.0: $(TOTEM_OBJS)
  127. $(CC) $(LDFLAGS) -bundle -bind_at_load $(TOTEM_OBJS) -o $@
  128. rm -f libtotem_pg.so.1 libtotem_pg.so
  129. ln -s libtotem_pg.so.1.0 libtotem_pg.so.1
  130. ln -s libtotem_pg.so.1.0 libtotem_pg.so
  131. else
  132. libtotem_pg.so.1.0: $(TOTEM_OBJS)
  133. $(CC) $(LDFLAGS) -shared -Wl,-soname,libtotem_pg.so.1 $(TOTEM_OBJS) -o $@
  134. rm -f libtotem_pg.so.1 libtotem_pg.so
  135. ln -s libtotem_pg.so.1.0 libtotem_pg.so.1
  136. ln -s libtotem_pg.so.1.0 libtotem_pg.so
  137. endif
  138. keygen: keygen.o
  139. $(CC) $(LDFLAGS) keygen.o -o keygen
  140. openais-instantiate: openais-instantiate.o
  141. $(CC) $(LDFLAGS) openais-instantiate.o -o openais-instantiate
  142. clean:
  143. 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
  144. depend:
  145. makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(EXEC_SRC) $(TOTEM_SRC) > /dev/null 2>&1
  146. # - fPIC rules required for service handler shared objects
  147. ../lcr/lcr_ifact.o: ../lcr/lcr_ifact.c
  148. $(CC) $(CFLAGS) $(CPPFLAGS) -I../lcr -c -o $@ ../lcr/lcr_ifact.c
  149. evs.o: evs.c
  150. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  151. clm.o: clm.c
  152. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  153. amf.o: amf.c
  154. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  155. ckpt.o: ckpt.c
  156. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  157. evt.o: evt.c
  158. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  159. lck.o: lck.c
  160. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  161. msg.o: msg.c
  162. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  163. cfg.o: cfg.c
  164. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  165. aisparser.o: aisparser.c
  166. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  167. vsf_ykd.o: vsf_ykd.c
  168. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  169. cpg.o: cpg.c
  170. $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
  171. objdb.o: objdb.c
  172. $(CC) $(CFLAGS) -c -o $@ $(*F).c
  173. # -fPIC rules required for lib totem
  174. aispoll.o: aispoll.c
  175. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  176. totempg.o: totempg.c
  177. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  178. totemsrp.o: totemsrp.c
  179. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  180. totemrrp.o: totemrrp.c
  181. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  182. totemip.o: totemip.c
  183. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  184. totemnet.o: totemnet.c
  185. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  186. wthread.o: wthread.c
  187. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  188. tlist.o: tlist.c
  189. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  190. crypto.o: crypto.c
  191. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  192. totemmrp.o: totemmrp.c
  193. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  194. totemconfig.o: totemconfig.c
  195. $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
  196. # DO NOT DELETE
  197. main.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  198. main.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  199. main.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h amfconfig.h
  200. main.o: main.h ../include/saClm.h service.h
  201. main.o: ../include/saEvt.h swab.h print.h
  202. clm.o: ../include/saAis.h ../include/saClm.h ../include/saAis.h
  203. clm.o: ../include/ipc_evs.h ../include/saClm.h ../include/ipc_gen.h
  204. clm.o: ../include/ipc_clm.h ../include/list.h ../include/queue.h aispoll.h
  205. clm.o: totempg.h totemsrp.h amfconfig.h main.h service.h
  206. clm.o: ../include/saEvt.h mempool.h print.h
  207. amf.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  208. amf.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  209. amf.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h util.h
  210. amf.o: amfconfig.h main.h ../include/saClm.h service.h
  211. amf.o: ../include/saEvt.h print.h
  212. ckpt.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  213. ckpt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  214. ckpt.o: ../include/queue.h aispoll.h mempool.h util.h amfconfig.h totempg.h
  215. ckpt.o: totemsrp.h main.h ../include/saClm.h service.h
  216. ckpt.o: ../include/saEvt.h print.h
  217. evt.o: ../include/ipc_evt.h ../include/saAis.h ../include/saEvt.h
  218. evt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  219. evt.o: ../include/queue.h util.h ../include/saAis.h aispoll.h mempool.h
  220. evt.o: amfconfig.h totempg.h totemsrp.h main.h ../include/saClm.h
  221. evt.o: ../include/ipc_evs.h service.h
  222. evt.o: ../include/saEvt.h swab.h print.h
  223. evs.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  224. evs.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  225. evs.o: ../include/queue.h aispoll.h totempg.h totemsrp.h amfconfig.h main.h
  226. evs.o: ../include/saClm.h service.h
  227. evs.o: ../include/saEvt.h mempool.h print.h
  228. amfconfig.o: ../include/saAis.h ../include/list.h util.h amfconfig.h aispoll.h
  229. amfconfig.o: totempg.h totemsrp.h mempool.h print.h ../include/saClm.h
  230. amfconfig.o: ../include/saAis.h
  231. print.o: print.h ../include/saAis.h ../include/saClm.h
  232. print.o: ../include/saAis.h amfconfig.h ../include/list.h aispoll.h totempg.h
  233. print.o: totemsrp.h
  234. mempool.o: ../include/list.h mempool.h
  235. util.o: ../include/saAis.h ../include/list.h util.h
  236. aispoll.o: aispoll.h ../include/list.h ../include/saAis.h tlist.h
  237. totemsrp.o: aispoll.h totemsrp.h ../include/queue.h ../include/sq.h
  238. totemsrp.o: ../include/list.h ../include/saAis.h swab.h crypto.h
  239. totempg.o: totempg.h aispoll.h totemsrp.h swab.h
  240. tlist.o: ../include/list.h tlist.h
  241. hdb.o: ../include/saAis.h
  242. crypto.o: crypto.h