Makefile 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. # Copyright (c) 2002-2005 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. # Production mode flags
  31. CFLAGS = -O3 -Wall -fomit-frame-pointer
  32. LDFLAGS = -lpthread
  33. # Debug mode flags
  34. #CFLAGS = -g -Wall
  35. ##-DDEBUG
  36. #LDFLAGS = -g -lpthread
  37. # Profile mode flags
  38. #CFLAGS = -O3 -pg
  39. #LDFLAGS = -pg -lpthread
  40. # Code Coverage with lcov flgs
  41. #CFLAGS = -ftest-coverage -fprofile-arcs
  42. #LDFLAGS = -g
  43. TOTEM_SRC = aispoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c totemconfig.c tlist.c hdb.c crypto.c wthread.c
  44. TOTEM_OBJS = aispoll.o totemip.o totemnet.o totemrrp.o totemsrp.o totemmrp.o totempg.o totemconfig.o tlist.o hdb.o crypto.o wthread.o
  45. EXEC_SRC = main.c clm.c amf.c ckpt.c evt.c lck.c evs.c mainparse.c print.c mempool.c \
  46. util.c sync.c ykd.c
  47. EXEC_OBJS = main.o clm.o amf.o ckpt.o evt.o lck.o evs.o mainparse.o print.o mempool.o \
  48. util.o sync.o ykd.o
  49. EXEC_LIBS = libtotem_pg.a
  50. OBJS = $(TOTEM_OBJS) $(EXEC_OBJS)
  51. all:libtotem_pg.a libtotem_pg.so.1.0 aisexec keygen
  52. aisexec: $(EXEC_OBJS) libtotem_pg.a
  53. $(CC) $(LDFLAGS) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec
  54. libtotem_pg.a: $(TOTEM_OBJS)
  55. $(AR) -rc libtotem_pg.a $(TOTEM_OBJS)
  56. libtotem_pg.so.1.0: $(TOTEM_OBJS)
  57. $(CC) -shared -Wl,-soname,libtotem_pg.so.1 $(TOTEM_OBJS) -o $@
  58. rm -f libtotem_pg.so.1 libtotem_pg.so
  59. ln -s libtotem_pg.so.1.0 libtotem_pg.so.1
  60. ln -s libtotem_pg.so.1.0 libtotem_pg.so
  61. keygen: keygen.o
  62. $(CC) $(LDFLAGS) keygen.o -o keygen
  63. clean:
  64. rm -f aisexec $(OBJS) libtotem_pg.so.1.0 libtotem_pg.so.1 libtotem_pg.so libtotem_pg.a gmon.out keygen keygen.o *.da *.bb *.bbg
  65. depend:
  66. makedepend -Y -- $(CFLAGS) $(EXEC_SRC) $(TOTEM_SRC) > /dev/null 2>&1
  67. # -fPIC rules required for lib totem
  68. aispoll.o: aispoll.c
  69. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  70. totempg.o: totempg.c
  71. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  72. totemsrp.o: totemsrp.c
  73. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  74. totemrrp.o: totemrrp.c
  75. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  76. totemip.o: totemip.c
  77. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  78. totemnet.o: totemnet.c
  79. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  80. wthread.o: wthread.c
  81. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  82. tlist.o: tlist.c
  83. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  84. hdb.o: hdb.c
  85. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  86. crypto.o: crypto.c
  87. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  88. totemmrp.o: totemmrp.c
  89. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  90. totemconfig.o: totemconfig.c
  91. $(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
  92. # DO NOT DELETE
  93. main.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  94. main.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  95. main.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h mainparse.h
  96. main.o: main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h hdb.h
  97. main.o: ../include/saEvt.h swab.h print.h
  98. clm.o: ../include/saAis.h ../include/saClm.h ../include/saAis.h
  99. clm.o: ../include/ipc_evs.h evs.h ../include/saClm.h ../include/ipc_gen.h
  100. clm.o: ../include/ipc_clm.h ../include/list.h ../include/queue.h aispoll.h
  101. clm.o: totempg.h totemsrp.h mainparse.h main.h clm.h amf.h handlers.h ckpt.h
  102. clm.o: evt.h hdb.h ../include/saEvt.h mempool.h print.h
  103. amf.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  104. amf.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  105. amf.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h util.h
  106. amf.o: mainparse.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h
  107. amf.o: hdb.h ../include/saEvt.h print.h
  108. ckpt.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  109. ckpt.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  110. ckpt.o: ../include/queue.h aispoll.h mempool.h util.h mainparse.h totempg.h
  111. ckpt.o: totemsrp.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h
  112. ckpt.o: evt.h hdb.h ../include/saEvt.h print.h
  113. evt.o: ../include/ipc_evt.h ../include/saAis.h ../include/saEvt.h
  114. evt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  115. evt.o: ../include/queue.h util.h ../include/saAis.h aispoll.h mempool.h
  116. evt.o: mainparse.h totempg.h totemsrp.h main.h evs.h clm.h ../include/saClm.h
  117. evt.o: amf.h ../include/ipc_evs.h handlers.h ckpt.h evt.h hdb.h
  118. evt.o: ../include/saEvt.h swab.h print.h
  119. evs.o: ../include/saAis.h ../include/ipc_evs.h ../include/saAis.h
  120. evs.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
  121. evs.o: ../include/queue.h aispoll.h totempg.h totemsrp.h mainparse.h main.h clm.h
  122. evs.o: ../include/saClm.h amf.h handlers.h ckpt.h evt.h hdb.h
  123. evs.o: ../include/saEvt.h mempool.h print.h
  124. mainparse.o: ../include/saAis.h ../include/list.h util.h mainparse.h aispoll.h
  125. mainparse.o: totempg.h totemsrp.h mempool.h print.h ../include/saClm.h
  126. mainparse.o: ../include/saAis.h
  127. print.o: print.h ../include/saAis.h ../include/saClm.h
  128. print.o: ../include/saAis.h mainparse.h ../include/list.h aispoll.h totempg.h
  129. print.o: totemsrp.h
  130. mempool.o: ../include/list.h mempool.h
  131. util.o: ../include/saAis.h ../include/list.h util.h
  132. aispoll.o: aispoll.h ../include/list.h hdb.h ../include/saAis.h tlist.h
  133. totemsrp.o: aispoll.h totemsrp.h ../include/queue.h ../include/sq.h
  134. totemsrp.o: ../include/list.h hdb.h ../include/saAis.h swab.h crypto.h
  135. totempg.o: totempg.h aispoll.h totemsrp.h swab.h
  136. tlist.o: ../include/list.h tlist.h
  137. hdb.o: hdb.h ../include/saAis.h
  138. crypto.o: crypto.h