Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. ALL=eap_example
  2. all: $(ALL)
  3. ifndef CC
  4. CC=gcc
  5. endif
  6. ifndef RANLIB
  7. RANLIB=ranlib
  8. endif
  9. ifndef CFLAGS
  10. CFLAGS = -MMD -O2 -Wall -g
  11. endif
  12. CFLAGS += -I.
  13. CFLAGS += -I../src
  14. CFLAGS += -I../src/utils
  15. OBJS_both += ../src/utils/libutils.a
  16. OBJS_both += ../src/crypto/libcrypto.a
  17. OBJS_both += ../src/tls/libtls.a
  18. OBJS_both += ../src/eap_common/eap_peap_common.o
  19. OBJS_both += ../src/eap_common/eap_psk_common.o
  20. OBJS_both += ../src/eap_common/eap_pax_common.o
  21. OBJS_both += ../src/eap_common/eap_sake_common.o
  22. OBJS_both += ../src/eap_common/eap_gpsk_common.o
  23. OBJS_both += ../src/eap_common/chap.o
  24. OBJS_peer += ../src/eap_peer/eap_tls.o
  25. OBJS_peer += ../src/eap_peer/eap_peap.o
  26. OBJS_peer += ../src/eap_peer/eap_ttls.o
  27. OBJS_peer += ../src/eap_peer/eap_md5.o
  28. OBJS_peer += ../src/eap_peer/eap_mschapv2.o
  29. OBJS_peer += ../src/eap_peer/mschapv2.o
  30. OBJS_peer += ../src/eap_peer/eap_otp.o
  31. OBJS_peer += ../src/eap_peer/eap_gtc.o
  32. OBJS_peer += ../src/eap_peer/eap_leap.o
  33. OBJS_peer += ../src/eap_peer/eap_psk.o
  34. OBJS_peer += ../src/eap_peer/eap_pax.o
  35. OBJS_peer += ../src/eap_peer/eap_sake.o
  36. OBJS_peer += ../src/eap_peer/eap_gpsk.o
  37. OBJS_peer += ../src/eap_peer/eap.o
  38. OBJS_peer += ../src/eap_common/eap_common.o
  39. OBJS_peer += ../src/eap_peer/eap_methods.o
  40. OBJS_peer += ../src/eap_peer/eap_tls_common.o
  41. CFLAGS += -DEAP_TLS
  42. CFLAGS += -DEAP_PEAP
  43. CFLAGS += -DEAP_TTLS
  44. CFLAGS += -DEAP_MD5
  45. CFLAGS += -DEAP_MSCHAPv2
  46. CFLAGS += -DEAP_GTC
  47. CFLAGS += -DEAP_OTP
  48. CFLAGS += -DEAP_LEAP
  49. CFLAGS += -DEAP_PSK
  50. CFLAGS += -DEAP_PAX
  51. CFLAGS += -DEAP_SAKE
  52. CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
  53. CFLAGS += -DEAP_SERVER_IDENTITY
  54. CFLAGS += -DEAP_SERVER_TLS
  55. CFLAGS += -DEAP_SERVER_PEAP
  56. CFLAGS += -DEAP_SERVER_TTLS
  57. CFLAGS += -DEAP_SERVER_MD5
  58. CFLAGS += -DEAP_SERVER_MSCHAPV2
  59. CFLAGS += -DEAP_SERVER_GTC
  60. CFLAGS += -DEAP_SERVER_PSK
  61. CFLAGS += -DEAP_SERVER_PAX
  62. CFLAGS += -DEAP_SERVER_SAKE
  63. CFLAGS += -DEAP_SERVER_GPSK -DEAP_SERVER_GPSK_SHA256
  64. CFLAGS += -DIEEE8021X_EAPOL
  65. # Optional components to add EAP server support
  66. OBJS_server += ../src/eap_server/eap_server_tls.o
  67. OBJS_server += ../src/eap_server/eap_server_peap.o
  68. OBJS_server += ../src/eap_server/eap_server_ttls.o
  69. OBJS_server += ../src/eap_server/eap_server_md5.o
  70. OBJS_server += ../src/eap_server/eap_server_mschapv2.o
  71. OBJS_server += ../src/eap_server/eap_server_gtc.o
  72. OBJS_server += ../src/eap_server/eap_server_psk.o
  73. OBJS_server += ../src/eap_server/eap_server_pax.o
  74. OBJS_server += ../src/eap_server/eap_server_sake.o
  75. OBJS_server += ../src/eap_server/eap_server_gpsk.o
  76. OBJS_server += ../src/eap_server/eap_server.o
  77. OBJS_server += ../src/eap_server/eap_server_identity.o
  78. OBJS_server += ../src/eap_server/eap_server_methods.o
  79. OBJS_server += ../src/eap_server/eap_server_tls_common.o
  80. CFLAGS += -DEAP_SERVER
  81. ifndef LDO
  82. LDO=$(CC)
  83. endif
  84. Q=@
  85. E=echo
  86. ifeq ($(V), 1)
  87. Q=
  88. E=true
  89. endif
  90. %.o: %.c
  91. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  92. @$(E) " CC " $<
  93. OBJS_lib=$(OBJS_both) $(OBJS_peer) $(OBJS_server)
  94. OBJS_ex = eap_example.o eap_example_peer.o eap_example_server.o
  95. ../src/utils/libutils.a:
  96. $(MAKE) -C ../src/utils
  97. ../src/crypto/libcrypto.a:
  98. $(MAKE) -C ../src/crypto
  99. ../src/tls/libtls.a:
  100. $(MAKE) -C ../src/tls
  101. ifneq ($(CONFIG_SOLIB), yes)
  102. LIBEAP = libeap.a
  103. libeap.a: $(OBJS_lib)
  104. $(AR) crT libeap.a $(OBJS_lib)
  105. $(RANLIB) libeap.a
  106. else
  107. CFLAGS += -fPIC -DPIC
  108. LDFLAGS += -shared
  109. LIBEAP = libeap.so
  110. libeap.so: $(OBJS_lib)
  111. $(LDO) $(LDFLAGS) $(OBJS_lib) -o $(LIBEAP)
  112. endif
  113. eap_example: $(OBJS_ex) $(LIBEAP)
  114. $(LDO) $(LDFLAGS) -o eap_example $(OBJS_ex) -L. -leap $(LIBS)
  115. clean:
  116. $(MAKE) -C ../src clean
  117. rm -f core *~ *.o *.d libeap.a libeap.so $(ALL)
  118. -include $(OBJS:%.o=%.d)