Makefile 13 KB

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